/*      */ package dm.jdbc.driver;
/*      */ 
/*      */ import dm.jdbc.dataConvertion.CnvtInfo;
/*      */ import dm.jdbc.dbaccess.AuthInfo;
/*      */ import dm.jdbc.dbaccess.Const;
/*      */ import dm.jdbc.dbaccess.DBError;
/*      */ import dm.jdbc.dbaccess.DbAccess;
/*      */ import dm.jdbc.dbaccess.DmMsgSend;
/*      */ import dm.jdbc.desc.DmServerInfo;
/*      */ import dm.jdbc.desc.DmSvcCfg;
/*      */ import dm.jdbc.desc.GlobalControlCfg;
/*      */ import dm.jdbc.innerData.DmdbExecOpt;
/*      */ import dm.jdbc.pool.DmdbPooledConnection_bs;
/*      */ import dm.jdbc.util.EscapeProcessor;
/*      */ import dm.jdbc.util.ExecOptProcessor;
/*      */ import dm.jdbc.util.StringUtil;
/*      */ import java.io.File;
/*      */ import java.io.FileOutputStream;
/*      */ import java.io.IOException;
/*      */ import java.io.PrintWriter;
/*      */ import java.net.InetAddress;
/*      */ import java.net.UnknownHostException;
/*      */ import java.sql.CallableStatement;
/*      */ import java.sql.Connection;
/*      */ import java.sql.DatabaseMetaData;
/*      */ import java.sql.DriverManager;
/*      */ import java.sql.DriverPropertyInfo;
/*      */ import java.sql.PreparedStatement;
/*      */ import java.sql.ResultSet;
/*      */ import java.sql.SQLException;
/*      */ import java.sql.SQLWarning;
/*      */ import java.sql.Savepoint;
/*      */ import java.sql.Statement;
/*      */ import java.util.ArrayList;
/*      */ import java.util.Collections;
/*      */ import java.util.Enumeration;
/*      */ import java.util.HashMap;
/*      */ import java.util.Hashtable;
/*      */ import java.util.LinkedList;
/*      */ import java.util.List;
/*      */ import java.util.Locale;
/*      */ import java.util.Map;
/*      */ import java.util.NoSuchElementException;
/*      */ import java.util.Properties;
/*      */ import java.util.ResourceBundle;
/*      */ import java.util.Vector;
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ public class DmdbConnection_bs
/*      */   implements Connection
/*      */ {
/*  116 */   private Object msgMutex = new Object();
/*  117 */   private boolean m_msgRelease = true;
/*  118 */   private ConnServAttr m_connServAttr = new ConnServAttr();
/*  119 */   private ConnStrAttr m_connStrAttr = new ConnStrAttr();
/*  120 */   private CnvtInfo m_cnvtInfo = new CnvtInfo();
/*      */   
/*  122 */   private Properties m_connProps = new Properties();
/*      */   
/*  124 */   private ArrayList m_servList = null;
/*  125 */   private int m_servPos = 0;
/*      */   
/*  127 */   private boolean m_isExecute2 = false;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   Hashtable statement_table;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   protected boolean closed;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   DmdbDatabaseMetaData_bs m_dbMetaData;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   private boolean logicalHandle;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   DmdbPooledConnection_bs m_pc;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   private int connectionHoldability;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   private SQLWarning m_warning;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*  167 */   private boolean m_readOnly = false;
/*      */   
/*      */ 
/*      */ 
/*      */   private DbAccess m_dbaccess;
/*      */   
/*      */ 
/*      */ 
/*      */   private DmdbSwitch m_switch;
/*      */   
/*      */ 
/*      */   private DmMsgSend m_msg;
/*      */   
/*      */ 
/*      */   private Statement svptStmt;
/*      */   
/*      */ 
/*  184 */   private final ResourceBundle res = Const.res;
/*      */   
/*      */   private String random;
/*      */   
/*  188 */   private boolean uKeyFlag = false;
/*      */   
/*      */   public void setUKeyFlag(boolean uKeyFlag) {
/*  191 */     this.uKeyFlag = uKeyFlag;
/*      */   }
/*      */   
/*      */   public boolean getUKeyFlag() {
/*  195 */     return this.uKeyFlag;
/*      */   }
/*      */   
/*      */   public void setRandom(String random) {
/*  199 */     this.random = random;
/*      */   }
/*      */   
/*      */   public String getRandom() {
/*  203 */     return this.random;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*  208 */   private Vector stmtPool = null;
/*  209 */   private Map preparedStmtPool = null;
/*  210 */   private List preparedStmtPoolArray = null;
/*  211 */   private Map callableStmtPool = null;
/*  212 */   private List callableStmtPoolArray = null;
/*      */   
/*  214 */   private Vector stmtsVec = null;
/*      */   
/*      */ 
/*      */ 
/*      */   private static final String svptPrefix = "DMDB_SVPT_";
/*      */   
/*      */ 
/*  221 */   public static int execSqlNum = 0;
/*  222 */   public static int rsCachedNum = 0;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*  228 */   private DriverPropertyInfo[] m_clientInfoArray = null;
/*  229 */   private Properties m_clientInfoMapConnStr = null;
/*      */   
/*  231 */   private String m_currentDBName = null;
/*      */   
/*      */   public void setCurrentDBName(String dbName) {
/*  234 */     this.m_currentDBName = dbName;
/*      */   }
/*      */   
/*      */   public String getCurrentDBName() {
/*  238 */     return this.m_currentDBName;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*  244 */   private boolean m_transReadonly = true;
/*  245 */   private String m_hostStandby = null;
/*  246 */   private int m_portStandby = 0;
/*  247 */   private Map m_typeMap = new HashMap();
/*  248 */   private static Integer curServer = new Integer(-1);
/*      */   public static final int TRANSACTION_NONE = 0;
/*      */   
/*  251 */   public void setTransReadonly(boolean readonly) throws SQLException { if ((this.m_connStrAttr.rwSeparate == 0) || (!checkHasStandby())) {
/*  252 */       return;
/*      */     }
/*  254 */     if (readonly)
/*      */     {
/*  256 */       if (Const.NTRX_P < (Const.NTRX_S + Const.NTRX_P) * this.m_connStrAttr.rwPercent / 100.0D) {
/*  257 */         Const.NTRX_P += 1L;
/*  258 */         this.m_transReadonly = false;
/*      */       } else {
/*  260 */         Const.NTRX_S += 1L;
/*  261 */         this.m_transReadonly = true;
/*      */       }
/*      */     } else {
/*  264 */       Const.NTRX_P += 1L;
/*  265 */       this.m_transReadonly = false;
/*      */     }
/*      */   }
/*      */   
/*      */   public boolean getTransReadonly()
/*      */   {
/*  271 */     return this.m_transReadonly;
/*      */   }
/*      */   
/*      */   public boolean checkConnToStandby() {
/*  275 */     if ((this.m_connStrAttr.rwSeparate == 1) && 
/*  276 */       (getTransLevel() != 8) && 
/*  277 */       (this.m_transReadonly) && 
/*  278 */       (this.m_hostStandby != null) && (this.m_hostStandby.length() > 0)) {
/*  279 */       return true;
/*      */     }
/*  281 */     return false;
/*      */   }
/*      */   
/*      */   public void setTransStatus(int status) throws SQLException {
/*  285 */     switch (status & 0xFFF)
/*      */     {
/*      */     case 0: 
/*      */     case 32: 
/*      */     case 64: 
/*  290 */       setTransReadonly(true);
/*  291 */       break;
/*      */     }
/*      */     
/*      */   }
/*      */   
/*      */ 
/*      */   public void setStandbyInfo(String host, int port)
/*      */   {
/*  299 */     this.m_hostStandby = host;
/*  300 */     this.m_portStandby = port;
/*      */   }
/*      */   
/*      */   public String getStandbyHost() {
/*  304 */     return this.m_hostStandby;
/*      */   }
/*      */   
/*      */   public int getStandbyPort() {
/*  308 */     return this.m_portStandby;
/*      */   }
/*      */   
/*      */   public boolean checkHasStandby() {
/*  312 */     if ((this.m_hostStandby == null) || (this.m_hostStandby.length() == 0)) {
/*  313 */       return false;
/*      */     }
/*  315 */     return true;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public DmdbConnection_bs(String s, String s1, String s2, String s3, String s4, String s5, Properties properties)
/*      */     throws SQLException
/*      */   {
/*  341 */     initialize(s.trim(), s1.trim(), s2.trim(), s3.trim(), s4.trim(), 
/*  342 */       properties);
/*  343 */     this.logicalHandle = false;
/*      */   }
/*      */   
/*      */   public DmdbConnection_bs() {
/*  347 */     setTz(GlobalControlCfg.getTimeZone());
/*      */     
/*  349 */     if (GlobalControlCfg.getLanguage().getLanguage().equalsIgnoreCase("zh")) {
/*  350 */       setLanguage(0);
/*      */     } else {
/*  352 */       setLanguage(1);
/*      */     }
/*  354 */     initClientInfoWithConnStr();
/*      */     
/*  356 */     this.connectionHoldability = 1;
/*  357 */     this.m_dbMetaData = null;
/*  358 */     this.m_pc = null;
/*  359 */     this.m_warning = null;
/*  360 */     this.statement_table = new Hashtable(10);
/*  361 */     this.svptStmt = null;
/*  362 */     this.stmtPool = new Vector(this.m_connStrAttr.stmtPoolSize);
/*  363 */     this.preparedStmtPool = Collections.synchronizedMap(new HashMap(
/*  364 */       this.m_connStrAttr.stmtPoolSize));
/*  365 */     this.preparedStmtPoolArray = Collections.synchronizedList(new LinkedList());
/*      */     
/*  367 */     this.callableStmtPool = Collections.synchronizedMap(new HashMap(
/*  368 */       this.m_connStrAttr.stmtPoolSize));
/*  369 */     this.callableStmtPoolArray = Collections.synchronizedList(new LinkedList());
/*      */     
/*      */ 
/*  372 */     this.stmtsVec = new Vector();
/*      */     
/*  374 */     this.closed = true;
/*  375 */     this.logicalHandle = false;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public DmdbConnection_bs getLogicalConnection(DmdbPooledConnection_bs pooledConnection)
/*      */   {
/*  392 */     this.logicalHandle = true;
/*  393 */     this.m_pc = pooledConnection;
/*  394 */     this.connectionHoldability = 1;
/*      */     
/*  396 */     if (Const.TRACE_LEVEL > 0) {
/*  397 */       DmdbLog.trace(this, "getPhysicalConnection", "");
/*      */     }
/*      */     
/*  400 */     return this;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   private void initialize(String s, String s1, String s2, String s3, String s4, Properties props)
/*      */     throws SQLException
/*      */   {
/*  422 */     setTz(GlobalControlCfg.getTimeZone());
/*      */     
/*  424 */     if (GlobalControlCfg.getLanguage().getLanguage().equalsIgnoreCase("zh")) {
/*  425 */       setLanguage(0);
/*      */     } else {
/*  427 */       setLanguage(1);
/*      */     }
/*  429 */     initServList(s1, s2);
/*      */     
/*  431 */     DmServerInfo tempServ = (DmServerInfo)this.m_servList.get(0);
/*  432 */     s1 = tempServ.getSvrName();
/*  433 */     if (tempServ.hasPort()) {
/*  434 */       s2 = String.valueOf(tempServ.getSvrPort());
/*      */     }
/*      */     
/*  437 */     initConnStrAttr(s, s3, s4, s1, s2, props);
/*      */     
/*  439 */     this.connectionHoldability = 1;
/*  440 */     this.m_dbMetaData = null;
/*  441 */     this.m_pc = null;
/*  442 */     this.m_warning = null;
/*  443 */     this.statement_table = new Hashtable(10);
/*  444 */     this.svptStmt = null;
/*  445 */     this.stmtPool = new Vector(this.m_connStrAttr.stmtPoolSize);
/*  446 */     this.preparedStmtPool = Collections.synchronizedMap(new HashMap(
/*  447 */       this.m_connStrAttr.stmtPoolSize));
/*  448 */     this.preparedStmtPoolArray = Collections.synchronizedList(new LinkedList());
/*      */     
/*  450 */     this.callableStmtPool = Collections.synchronizedMap(new HashMap(
/*  451 */       this.m_connStrAttr.stmtPoolSize));
/*  452 */     this.callableStmtPoolArray = Collections.synchronizedList(new LinkedList());
/*      */     
/*      */ 
/*  455 */     this.stmtsVec = new Vector();
/*      */     
/*  457 */     this.m_connProps = ((Properties)props.clone());
/*  458 */     this.m_connProps.remove("password");
/*      */     
/*  460 */     commInit();
/*      */   }
/*      */   
/*      */   private void initDefaultClientInfo() {
/*  464 */     if (this.m_clientInfoArray == null)
/*      */     {
/*  466 */       DriverPropertyInfo continueBatchOnError = new DriverPropertyInfo(
/*  467 */         "continueBatchOnError", "false");
/*  468 */       continueBatchOnError.description = this.res
/*  469 */         .getString("desciption.execute.continue");
/*      */       
/*  471 */       DriverPropertyInfo LobMode = new DriverPropertyInfo("LobMode", "1");
/*  472 */       LobMode.description = this.res.getString("desciption.lob.mode");
/*      */       
/*  474 */       DriverPropertyInfo ignoreCase = new DriverPropertyInfo(
/*  475 */         "ignoreCase", "true");
/*  476 */       ignoreCase.description = this.res.getString("description.ignoreCase");
/*      */       
/*      */ 
/*  479 */       DriverPropertyInfo comOra = new DriverPropertyInfo("comOra", 
/*  480 */         "false");
/*  481 */       comOra.description = this.res.getString("description.comOra");
/*      */       
/*  483 */       DriverPropertyInfo infoLevel = new DriverPropertyInfo("infoLevel", 
/*  484 */         "1");
/*  485 */       infoLevel.description = this.res.getString("description.infoLevel");
/*      */       
/*  487 */       DriverPropertyInfo batchType = new DriverPropertyInfo("batchType", 
/*  488 */         "1");
/*  489 */       batchType.description = this.res.getString("description.batchType");
/*      */       
/*  491 */       DriverPropertyInfo traceLevel = new DriverPropertyInfo(
/*  492 */         "traceLevel", "0");
/*  493 */       traceLevel.description = this.res.getString("description.traceLevel");
/*      */       
/*  495 */       DriverPropertyInfo appName = new DriverPropertyInfo(
/*  496 */         "ApplicationName", "");
/*  497 */       appName.description = this.res.getString("description.appName");
/*      */       
/*  499 */       DriverPropertyInfo userProp = new DriverPropertyInfo("ClientUser", 
/*  500 */         "");
/*  501 */       userProp.description = this.res.getString("description.clientUser");
/*      */       
/*  503 */       DriverPropertyInfo hostProp = new DriverPropertyInfo(
/*  504 */         "ClientHostname", "localhost");
/*  505 */       hostProp.description = this.res.getString("description.clientHostname");
/*      */       
/*  507 */       this.m_clientInfoArray = new DriverPropertyInfo[] {
/*  508 */         continueBatchOnError, LobMode, ignoreCase, comOra, 
/*  509 */         infoLevel, batchType, traceLevel, appName, userProp, 
/*  510 */         hostProp };
/*      */     }
/*      */   }
/*      */   
/*      */   private void initClientInfoWithConnStr() {
/*  515 */     if (this.m_clientInfoMapConnStr == null)
/*  516 */       this.m_clientInfoMapConnStr = new Properties();
/*  517 */     this.m_clientInfoMapConnStr.clear();
/*      */     
/*  519 */     this.m_clientInfoMapConnStr.setProperty("comOra", 
/*  520 */       String.valueOf(this.m_connStrAttr.comOra));
/*  521 */     this.m_clientInfoMapConnStr.setProperty("ClientUser", 
/*  522 */       String.valueOf(this.m_connStrAttr.login));
/*  523 */     this.m_clientInfoMapConnStr.setProperty("ClientHostname", 
/*  524 */       String.valueOf(this.m_connStrAttr.host));
/*  525 */     this.m_clientInfoMapConnStr.setProperty("continueBatchOnError", 
/*  526 */       String.valueOf(this.m_connStrAttr.continueBatchOnError));
/*  527 */     this.m_clientInfoMapConnStr.setProperty("LobMode", 
/*  528 */       String.valueOf(this.m_connStrAttr.lob_mode));
/*  529 */     this.m_clientInfoMapConnStr.setProperty("ignoreCase", 
/*  530 */       String.valueOf(this.m_connStrAttr.ignoreCase));
/*  531 */     this.m_clientInfoMapConnStr.setProperty("infoLevel", 
/*  532 */       String.valueOf(this.m_connStrAttr.infoLevel));
/*  533 */     this.m_clientInfoMapConnStr.setProperty("batchType", 
/*  534 */       String.valueOf(this.m_connStrAttr.batchType));
/*  535 */     this.m_clientInfoMapConnStr.setProperty("traceLevel", 
/*  536 */       String.valueOf(this.m_connStrAttr.traceLevel));
/*  537 */     this.m_clientInfoMapConnStr.setProperty("ApplicationName", 
/*  538 */       String.valueOf(this.m_connStrAttr.appName));
/*  539 */     this.m_clientInfoMapConnStr.setProperty("ApplicationName", 
/*  540 */       String.valueOf(this.m_connStrAttr.appName));
/*      */   }
/*      */   
/*      */   public ResultSet getDefaultClientInfo() throws SQLException
/*      */   {
/*  545 */     StringBuffer stringBuffer = new StringBuffer(
/*  546 */       "declare \ntype RowVal is record (NAME varchar(128), MAX_LEN int, DEFAULT_VALUE varchar(50), DESCRIPTION varchar(512)); \ntype RowVals is array RowVal[];\nr RowVal; \nrs RowVals;\n");
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*  551 */     stringBuffer.append("begin \n");
/*      */     
/*  553 */     int len = this.m_clientInfoArray.length;
/*  554 */     stringBuffer.append("rs = new RowVal[" + len + "]; \n");
/*      */     
/*  556 */     for (int i = 0; i < len; i++) {
/*  557 */       stringBuffer.append("r.name = '" + this.m_clientInfoArray[i].name + 
/*  558 */         "';\n");
/*  559 */       stringBuffer.append("r.max_len = 128;\n");
/*  560 */       stringBuffer.append("r.default_value = '" + 
/*  561 */         this.m_clientInfoArray[i].value + "';\n");
/*  562 */       stringBuffer.append("r.description = '" + 
/*  563 */         this.m_clientInfoArray[i].description + "';\n");
/*      */       
/*  565 */       int index = i + 1;
/*  566 */       stringBuffer.append("rs[" + index + "] = r;\n");
/*      */     }
/*      */     
/*      */ 
/*  570 */     stringBuffer.append("select * from array rs;\n");
/*  571 */     stringBuffer.append("end;");
/*      */     
/*  573 */     DmdbStatement_bs stmt = (DmdbStatement_bs)createStatement();
/*  574 */     DmdbResultSet_bs rs = (DmdbResultSet_bs)stmt.executeQuery(
/*  575 */       stringBuffer.toString(), 1);
/*  576 */     stringBuffer = null;
/*  577 */     stmt.close();
/*  578 */     stmt = null;
/*      */     
/*  580 */     return rs;
/*      */   }
/*      */   
/*      */   private void resetClientInfo() {
/*  584 */     initClientInfoWithConnStr();
/*      */   }
/*      */   
/*      */   private void initServList(String host, String port) {
/*  588 */     DmSvcCfg svcCfg = new DmSvcCfg();
/*  589 */     DmServerInfo tmp = null;
/*      */     
/*  591 */     this.m_servList = svcCfg.getServerStrct(host);
/*  592 */     if ((this.m_servList == null) || (this.m_servList.size() <= 0)) {
/*  593 */       this.m_servList = new ArrayList();
/*  594 */       tmp = new DmServerInfo(host, Integer.parseInt(port));
/*  595 */       this.m_servList.add(tmp);
/*      */       
/*  597 */       return;
/*      */     }
/*      */   }
/*      */   
/*      */   private void KerberosProtocal(String kerberosUser, String loginPath)
/*      */     throws SQLException
/*      */   {
/*  604 */     AuthInfo clientAuthInfo = this.m_dbaccess.getAuthInfo(kerberosUser, 
/*  605 */       loginPath, 2);
/*      */     
/*  607 */     if (clientAuthInfo == null) {
/*  608 */       DBError.throwSQLException(6001);
/*      */     }
/*  610 */     String user = "///" + clientAuthInfo.getUserName();
/*      */     
/*      */ 
/*  613 */     setLoginName(user);
/*      */   }
/*      */   
/*      */   IOException tryConnInner(int[] valid, int curSvr, boolean tryValid) {
/*  617 */     DmServerInfo tmp = (DmServerInfo)this.m_servList.get(curSvr);
/*  618 */     IOException io = null;
/*  619 */     if (((tryValid) && (tmp.isValid())) || ((!tryValid) && (!tmp.isValid()))) {
/*  620 */       setHostName(tmp.getSvrName());
/*  621 */       if (tmp.hasPort()) {
/*  622 */         setHostPort(tmp.getSvrPort());
/*      */       } else {
/*  624 */         setHostPort(Integer.valueOf(
/*  625 */           this.m_connProps.getProperty("port", "5236")).intValue());
/*      */       }
/*      */       try
/*      */       {
/*  629 */         this.m_dbaccess = new DbAccess(this);
/*  630 */         this.m_dbaccess.setSoTimeout(getSocketTimeout());
/*  631 */         setNetworkPacketSize(this.m_dbaccess.getNetPacketSize());
/*      */         
/*  633 */         setServPos(curSvr);
/*      */       } catch (IOException tio) {
/*  635 */         tmp.setValid(false);
/*  636 */         valid[curSvr] = -1;
/*  637 */         io = tio;
/*      */       }
/*      */     } else {
/*  640 */       valid[curSvr] = -1;
/*  641 */       io = new IOException(Const.res.getString("error.cumunationError"));
/*      */     }
/*  643 */     return io;
/*      */   }
/*      */   
/*      */   IOException tryConnWellDistributed(int serverCount, boolean tryValid)
/*      */   {
/*  648 */     int i = 0;
/*  649 */     int curSvr = 0;
/*  650 */     IOException ioTemp = null;
/*  651 */     int[] valid = new int[serverCount];
/*  652 */     for (i = 0; i < serverCount; i++) {
/*  653 */       valid[i] = i;
/*      */     }
/*  655 */     for (i = 0; i < serverCount; i++) {
/*  656 */       synchronized (curServer) {
/*  657 */         if (curServer.intValue() >= 0) {
/*  658 */           curSvr = (curServer.intValue() + 1) % serverCount;
/*      */         } else {
/*  660 */           curSvr = (int)(Math.random() * 1.0E9D) % serverCount;
/*      */         }
/*  662 */         curServer = new Integer(curSvr);
/*      */       }
/*      */       
/*  665 */       if (valid[curSvr] >= 0) {
/*  666 */         ioTemp = tryConnInner(valid, curSvr, tryValid);
/*  667 */         if (ioTemp == null) {
/*      */           break;
/*      */         }
/*      */       } else {
/*  671 */         i--;
/*      */       }
/*      */     }
/*  674 */     if (i == serverCount) {
/*  675 */       return ioTemp;
/*      */     }
/*  677 */     return null;
/*      */   }
/*      */   
/*      */   IOException tryConnRandom(int serverCount, boolean tryValid) {
/*  681 */     int fold = (int)(Math.random() * 1.0E9D);
/*  682 */     int rand = fold % serverCount;
/*  683 */     IOException ioTemp = null;
/*  684 */     int i = 0;
/*  685 */     int[] valid = new int[serverCount];
/*  686 */     for (i = 0; i < serverCount; i++) {
/*  687 */       valid[i] = i;
/*      */     }
/*      */     
/*  690 */     for (i = 0; i < serverCount; i++) {
/*  691 */       if (valid[rand] >= 0) {
/*  692 */         ioTemp = tryConnInner(valid, rand, tryValid);
/*  693 */         if (ioTemp == null) {
/*      */           break;
/*      */         }
/*      */       } else {
/*  697 */         i--;
/*      */       }
/*  699 */       rand = (rand + 1) % serverCount;
/*      */     }
/*  701 */     if (i == serverCount) {
/*  702 */       return ioTemp;
/*      */     }
/*  704 */     return null;
/*      */   }
/*      */   
/*      */   void tcpIpProtocal()
/*      */     throws IOException
/*      */   {
/*  710 */     int serverCount = this.m_servList.size();
/*  711 */     IOException io = null;
/*      */     
/*  713 */     if (this.m_connStrAttr.wellDistributed) {
/*  714 */       io = tryConnWellDistributed(serverCount, true);
/*  715 */       if (io != null) {
/*  716 */         io = tryConnWellDistributed(serverCount, false);
/*  717 */         if (io != null) {
/*  718 */           throw io;
/*      */         }
/*      */       }
/*      */     } else {
/*  722 */       io = tryConnRandom(serverCount, true);
/*  723 */       if (io != null) {
/*  724 */         io = tryConnRandom(serverCount, false);
/*  725 */         if (io != null) {
/*  726 */           throw io;
/*      */         }
/*      */       }
/*      */     }
/*      */   }
/*      */   
/*      */   private void commInit() throws SQLException {
/*  733 */     this.m_switch = new DmdbSwitch(this);
/*  734 */     this.m_msg = new DmMsgSend();
/*      */     
/*  736 */     openConnection();
/*      */   }
/*      */   
/*      */   private void commUnInit() {
/*  740 */     this.m_msg = null;
/*      */     
/*  742 */     if (this.m_dbaccess != null) {
/*  743 */       this.m_dbaccess.close();
/*  744 */       this.m_dbaccess = null;
/*      */     }
/*      */     
/*  747 */     this.m_switch = null;
/*      */   }
/*      */   
/*      */   private void conCommLayer() throws SQLException, IOException {
/*  751 */     tcpIpProtocal();
/*      */     
/*      */ 
/*  754 */     String user = getLoginName();
/*  755 */     if ((user.length() > 2) && (user.startsWith("///"))) {
/*  756 */       KerberosProtocal(user.substring(3), 
/*  757 */         this.m_connStrAttr.kerberosLoginConfPath);
/*      */     }
/*      */   }
/*      */   
/*      */   private void openConnection() throws SQLException {
/*      */     try {
/*  763 */       conCommLayer();
/*      */       
/*      */ 
/*  766 */       DmdbCSI.connToServer(this);
/*      */       
/*  768 */       this.closed = false;
/*      */     } catch (IOException io) {
/*  770 */       commUnInit();
/*  771 */       this.closed = true;
/*  772 */       DBError.throwSQLException(6001);
/*      */     } catch (SQLException e) {
/*  774 */       commUnInit();
/*  775 */       this.closed = true;
/*  776 */       throw e;
/*      */     }
/*      */   }
/*      */   
/*      */   public void setClientInfo(String name, String value) {
/*  781 */     if ((name == null) || (value == null)) {
/*  782 */       return;
/*      */     }
/*  784 */     this.m_clientInfoMapConnStr.setProperty(name, value);
/*  785 */     if (name.equalsIgnoreCase("traceLevel"))
/*  786 */       Const.TRACE_LEVEL = Integer.parseInt(value);
/*      */   }
/*      */   
/*      */   public void setClientInfo(Properties props) {
/*  790 */     if ((props == null) || (props.size() == 0)) {
/*  791 */       this.m_clientInfoMapConnStr.clear();
/*  792 */       return;
/*      */     }
/*      */     
/*  795 */     this.m_clientInfoMapConnStr = ((Properties)props.clone());
/*      */   }
/*      */   
/*      */   public String getClientInfo(String name) {
/*  799 */     if (name.equalsIgnoreCase("appName"))
/*  800 */       name = "ApplicationName";
/*  801 */     if (name.equalsIgnoreCase("user"))
/*  802 */       name = "ClientUser";
/*  803 */     if (name.equalsIgnoreCase("host")) {
/*  804 */       name = "ClientHostname";
/*      */     }
/*  806 */     return this.m_clientInfoMapConnStr.getProperty(name);
/*      */   }
/*      */   
/*      */   public Properties getClientInfo() {
/*  810 */     return (Properties)this.m_clientInfoMapConnStr.clone();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public boolean isLogicalConnection()
/*      */   {
/*  819 */     return this.logicalHandle;
/*      */   }
/*      */   
/*      */   public void unLogicalConnection() {
/*  823 */     this.logicalHandle = false;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized Statement createStatement()
/*      */     throws SQLException
/*      */   {
/*  842 */     if (Const.TRACE_LEVEL > 0) {
/*  843 */       DmdbLog.trace(this, "createStatement()", "");
/*      */     }
/*      */     
/*  846 */     clearWarnings();
/*  847 */     checkClosed();
/*  848 */     DmdbStatement_bs dmStatement = null;
/*      */     
/*  850 */     if (this.stmtPool.size() > 0) {
/*  851 */       dmStatement = getFromStmtPool();
/*  852 */       dmStatement.initializeReuseStmt(this);
/*      */     } else {
/*  854 */       dmStatement = new DmdbStatement_bs(this, 
/*  855 */         this.m_connStrAttr.resultSetType, 1007, 
/*  856 */         this.connectionHoldability);
/*      */     }
/*      */     
/*      */ 
/*  860 */     addStmt(dmStatement);
/*      */     
/*  862 */     return dmStatement;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized PreparedStatement prepareStatement(String sql)
/*      */     throws SQLException
/*      */   {
/*  898 */     return prepareStatement(sql, this.m_connStrAttr.resultSetType, 
/*  899 */       1007, this.connectionHoldability);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized CallableStatement prepareCall(String sql)
/*      */     throws SQLException
/*      */   {
/*  932 */     return prepareCall(sql, this.m_connStrAttr.resultSetType, 
/*  933 */       1007, this.connectionHoldability);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public String nativeSQL(String sql)
/*      */     throws SQLException
/*      */   {
/*  951 */     checkClosed();
/*      */     
/*  953 */     EscapeProcessor escPro = new EscapeProcessor();
/*  954 */     escPro.setExcpThrow(true);
/*  955 */     return escPro.escapeSQL(sql, this.m_connStrAttr.m_process_escapes, false);
/*      */   }
/*      */   
/*      */   String nativeSQL(String sql, boolean escape) throws SQLException {
/*  959 */     EscapeProcessor escPro = new EscapeProcessor();
/*  960 */     return escPro.escapeSQL(sql, escape, false);
/*      */   }
/*      */   
/*      */   DmdbExecOpt nativeSQL_ExecOpt(String sql, boolean escap) throws SQLException
/*      */   {
/*  965 */     EscapeProcessor escPro = new EscapeProcessor();
/*  966 */     String escSql = escPro.escapeSQL(sql, escap, true);
/*      */     
/*  968 */     ExecOptProcessor execPro = new ExecOptProcessor(getServerEncoding(), 
/*  969 */       escPro.hasError(), escPro.getWordList());
/*  970 */     return execPro.getExecOpt(escSql);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void setAutoCommit(boolean autoCommit)
/*      */     throws SQLException
/*      */   {
/* 1007 */     if (Const.TRACE_LEVEL > 0) {
/* 1008 */       DmdbLog.trace(this, "setAutoCommit(boolean)", "autoCommit = " + 
/* 1009 */         String.valueOf(autoCommit));
/*      */     }
/*      */     
/* 1012 */     checkClosed();
/*      */     
/* 1014 */     this.m_connStrAttr.auto_commit = autoCommit;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public boolean getAutoCommit()
/*      */     throws SQLException
/*      */   {
/* 1028 */     if (Const.TRACE_LEVEL > 0) {
/* 1029 */       DmdbLog.trace(this, "getAutoCommit()", "");
/*      */     }
/*      */     
/* 1032 */     return this.m_connStrAttr.auto_commit;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void commit()
/*      */     throws SQLException
/*      */   {
/* 1047 */     if (Const.TRACE_LEVEL > 0) {
/* 1048 */       DmdbLog.trace(this, "commit()", "");
/*      */     }
/*      */     
/* 1051 */     checkClosed();
/*      */     
/* 1053 */     if (getAutoCommit()) {
/* 1054 */       if (this.m_connStrAttr.alwayseAllowCommit) {
/* 1055 */         return;
/*      */       }
/* 1057 */       DBError.throwSQLException(6042);
/*      */     }
/*      */     
/* 1060 */     DmdbCSI.commitWork(this, this.connectionHoldability);
/*      */     
/* 1062 */     setTransReadonly(true);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void rollback()
/*      */     throws SQLException
/*      */   {
/* 1076 */     if (Const.TRACE_LEVEL > 0) {
/* 1077 */       DmdbLog.trace(this, "rollback()", "");
/*      */     }
/*      */     
/* 1080 */     checkClosed();
/*      */     
/* 1082 */     if (getAutoCommit()) {
/* 1083 */       if (this.m_connStrAttr.alwayseAllowCommit) {
/* 1084 */         return;
/*      */       }
/* 1086 */       DBError.throwSQLException(6043);
/*      */     }
/*      */     
/* 1089 */     DmdbCSI.rollbackWork(this, this.connectionHoldability);
/*      */     
/* 1091 */     setTransReadonly(true);
/*      */   }
/*      */   
/*      */   void checkClosed() throws SQLException {
/* 1095 */     if (isClosed()) {
/* 1096 */       DBError.throwSQLException(6060);
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void close()
/*      */     throws SQLException
/*      */   {
/* 1116 */     if (Const.TRACE_LEVEL > 0) {
/* 1117 */       DmdbLog.trace(this, "close()", "");
/*      */     }
/*      */     
/* 1120 */     if (this.closed) {
/* 1121 */       return;
/*      */     }
/*      */     try
/*      */     {
/*      */       try {
/* 1126 */         close_statements();
/*      */         
/* 1128 */         if (this.svptStmt != null) {
/* 1129 */           this.svptStmt.close();
/* 1130 */           this.svptStmt = null;
/*      */         }
/*      */         
/* 1133 */         invalidAllStmt();
/*      */       }
/*      */       catch (Exception localException) {}
/*      */       
/*      */ 
/*      */       try
/*      */       {
/* 1140 */         if (this.logicalHandle) {
/* 1141 */           logicalClose();
/* 1142 */           return;
/*      */         }
/*      */         
/*      */       }
/*      */       catch (Exception localException1)
/*      */       {
/* 1148 */         if (this.m_dbaccess != null) {
/* 1149 */           this.m_dbaccess.close();
/*      */         }
/* 1151 */         if (this.m_switch != null) {
/* 1152 */           this.m_switch.close();
/*      */         }
/* 1154 */         if (this.m_msg != null) {
/* 1155 */           this.m_msg.clear();
/*      */         }
/* 1157 */         this.m_hostStandby = null;
/* 1158 */         this.m_portStandby = 0;
/* 1159 */         this.m_transReadonly = true;
/*      */       }
/*      */       
/* 1162 */       if (this.logicalHandle) return; } finally { if (!this.logicalHandle) {
/* 1163 */         cleanup();
/* 1164 */         this.closed = true;
/*      */       }
/*      */     }
/* 1163 */     cleanup();
/* 1164 */     this.closed = true;
/*      */   }
/*      */   
/*      */   public synchronized void closeSimple()
/*      */     throws SQLException
/*      */   {
/* 1170 */     if (this.closed) {
/* 1171 */       return;
/*      */     }
/*      */     
/* 1174 */     invalidAllStmt();
/*      */     
/* 1176 */     if (this.m_dbaccess != null) {
/* 1177 */       this.m_dbaccess.close();
/*      */     }
/* 1179 */     this.closed = true;
/*      */   }
/*      */   
/*      */   public void resetCloseFlag() {
/* 1183 */     this.closed = false;
/*      */   }
/*      */   
/*      */   /* Error */
/*      */   public synchronized void closeForAgent()
/*      */     throws SQLException
/*      */   {
/*      */     // Byte code:
/*      */     //   0: aload_0
/*      */     //   1: getfield 321	dm/jdbc/driver/DmdbConnection_bs:closed	Z
/*      */     //   4: ifeq +4 -> 8
/*      */     //   7: return
/*      */     //   8: aload_0
/*      */     //   9: getfield 584	dm/jdbc/driver/DmdbConnection_bs:m_dbaccess	Ldm/jdbc/dbaccess/DbAccess;
/*      */     //   12: ifnull +10 -> 22
/*      */     //   15: aload_0
/*      */     //   16: getfield 584	dm/jdbc/driver/DmdbConnection_bs:m_dbaccess	Ldm/jdbc/dbaccess/DbAccess;
/*      */     //   19: invokevirtual 705	dm/jdbc/dbaccess/DbAccess:close	()V
/*      */     //   22: aload_0
/*      */     //   23: getfield 694	dm/jdbc/driver/DmdbConnection_bs:m_switch	Ldm/jdbc/driver/DmdbSwitch;
/*      */     //   26: ifnull +25 -> 51
/*      */     //   29: aload_0
/*      */     //   30: getfield 694	dm/jdbc/driver/DmdbConnection_bs:m_switch	Ldm/jdbc/driver/DmdbSwitch;
/*      */     //   33: invokevirtual 877	dm/jdbc/driver/DmdbSwitch:close	()V
/*      */     //   36: goto +15 -> 51
/*      */     //   39: astore_1
/*      */     //   40: aload_0
/*      */     //   41: invokespecial 874	dm/jdbc/driver/DmdbConnection_bs:cleanup	()V
/*      */     //   44: aload_0
/*      */     //   45: iconst_1
/*      */     //   46: putfield 321	dm/jdbc/driver/DmdbConnection_bs:closed	Z
/*      */     //   49: aload_1
/*      */     //   50: athrow
/*      */     //   51: aload_0
/*      */     //   52: invokespecial 874	dm/jdbc/driver/DmdbConnection_bs:cleanup	()V
/*      */     //   55: aload_0
/*      */     //   56: iconst_1
/*      */     //   57: putfield 321	dm/jdbc/driver/DmdbConnection_bs:closed	Z
/*      */     //   60: return
/*      */     // Line number table:
/*      */     //   Java source line #1187	-> byte code offset #0
/*      */     //   Java source line #1188	-> byte code offset #7
/*      */     //   Java source line #1192	-> byte code offset #8
/*      */     //   Java source line #1193	-> byte code offset #15
/*      */     //   Java source line #1195	-> byte code offset #22
/*      */     //   Java source line #1196	-> byte code offset #29
/*      */     //   Java source line #1198	-> byte code offset #36
/*      */     //   Java source line #1199	-> byte code offset #40
/*      */     //   Java source line #1200	-> byte code offset #44
/*      */     //   Java source line #1201	-> byte code offset #49
/*      */     //   Java source line #1199	-> byte code offset #51
/*      */     //   Java source line #1200	-> byte code offset #55
/*      */     //   Java source line #1202	-> byte code offset #60
/*      */     // Local variable table:
/*      */     //   start	length	slot	name	signature
/*      */     //   0	61	0	this	DmdbConnection_bs
/*      */     //   39	11	1	localObject	Object
/*      */     // Exception table:
/*      */     //   from	to	target	type
/*      */     //   8	39	39	finally
/*      */   }
/*      */   
/*      */   public synchronized void logicalClose()
/*      */     throws SQLException
/*      */   {
/* 1205 */     if (this.m_pc != null) {
/* 1206 */       this.m_pc.logicalClose();
/*      */     }
/*      */     
/* 1209 */     resetClientInfo();
/*      */   }
/*      */   
/*      */   private void cleanup() {
/* 1213 */     if (this.statement_table != null) {
/* 1214 */       this.statement_table.clear();
/*      */     }
/* 1216 */     this.statement_table = null;
/*      */     
/* 1218 */     this.m_pc = null;
/* 1219 */     this.m_dbMetaData = null;
/*      */     
/* 1221 */     this.m_clientInfoArray = null;
/*      */     
/* 1223 */     this.m_dbaccess = null;
/* 1224 */     this.m_switch = null;
/*      */     
/* 1226 */     this.m_warning = null;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public boolean isClosed()
/*      */     throws SQLException
/*      */   {
/* 1247 */     if (Const.TRACE_LEVEL > 0) {
/* 1248 */       DmdbLog.trace(this, "isClosed()", "");
/*      */     }
/*      */     
/* 1251 */     return this.closed;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized DatabaseMetaData getMetaData()
/*      */     throws SQLException
/*      */   {
/* 1270 */     if (Const.TRACE_LEVEL > 0) {
/* 1271 */       DmdbLog.trace(this, "getMetaData()", "");
/*      */     }
/*      */     
/* 1274 */     checkClosed();
/*      */     
/* 1276 */     if (this.m_dbMetaData == null) {
/* 1277 */       this.m_dbMetaData = new DmdbDatabaseMetaData_bs(this);
/*      */     }
/*      */     
/* 1280 */     return this.m_dbMetaData;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void setReadOnly(boolean readOnly)
/*      */     throws SQLException
/*      */   {
/* 1299 */     if (Const.TRACE_LEVEL > 0) {
/* 1300 */       DmdbLog.trace(this, "setReadOnly(boolean)", 
/* 1301 */         "readOnly = " + String.valueOf(readOnly));
/*      */     }
/*      */     
/* 1304 */     checkClosed();
/*      */     
/* 1306 */     if (this.m_readOnly == readOnly)
/*      */     {
/* 1308 */       return;
/*      */     }
/* 1310 */     Statement stmt = createStatement();
/*      */     
/* 1312 */     if (!this.m_connStrAttr.auto_commit) {
/* 1313 */       commit();
/*      */     }
/*      */     
/* 1316 */     setTransReadonly(false);
/*      */     
/* 1318 */     if (readOnly) {
/* 1319 */       stmt.execute("SP_SET_SESSION_READONLY(1)");
/*      */     } else {
/* 1321 */       stmt.execute("SP_SET_SESSION_READONLY(0)");
/*      */     }
/* 1323 */     if (!this.m_connStrAttr.auto_commit) {
/* 1324 */       commit();
/*      */     }
/* 1326 */     if (stmt != null) {
/* 1327 */       stmt.close();
/* 1328 */       stmt = null;
/*      */     }
/* 1330 */     this.m_readOnly = readOnly;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public boolean isReadOnly()
/*      */     throws SQLException
/*      */   {
/* 1343 */     if (Const.TRACE_LEVEL > 0) {
/* 1344 */       DmdbLog.trace(this, "isReadOnly", "");
/*      */     }
/*      */     
/* 1347 */     return this.m_readOnly;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public void setCatalog(String catalog)
/*      */     throws SQLException
/*      */   {
/* 1365 */     if (Const.TRACE_LEVEL > 0) {
/* 1366 */       DmdbLog.trace(this, "setCatalog(String)", "catalog = " + catalog);
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public String getCatalog()
/*      */     throws SQLException
/*      */   {
/* 1381 */     if (Const.TRACE_LEVEL > 0) {
/* 1382 */       DmdbLog.trace(this, "getCatalog()", "");
/*      */     }
/*      */     
/* 1385 */     return null;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public final String getUserName()
/*      */     throws SQLException
/*      */   {
/* 1394 */     DmdbStatement_bs stmt = (DmdbStatement_bs)createStatement(
/* 1395 */       1004, 1007, 
/* 1396 */       1);
/* 1397 */     ResultSet rs = stmt.executeQuery("select user()", 1);
/*      */     
/* 1399 */     rs.next();
/* 1400 */     String s = rs.getString(1);
/* 1401 */     rs.close();
/*      */     
/* 1403 */     stmt.close();
/*      */     
/* 1405 */     return s;
/*      */   }
/*      */   
/*      */   public final boolean isCompress()
/*      */   {
/* 1410 */     return this.m_connStrAttr.isCompress;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static final int TRANSACTION_READ_UNCOMMITTED = 1;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static final int TRANSACTION_READ_COMMITTED = 2;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static final int TRANSACTION_REPEATABLE_READ = 4;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public static final int TRANSACTION_SERIALIZABLE = 8;
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void setTransactionIsolation(int level)
/*      */     throws SQLException
/*      */   {
/* 1482 */     if (Const.TRACE_LEVEL > 0) {
/* 1483 */       DmdbLog.trace(this, "setTransactionIsolation(int)", "level = " + 
/* 1484 */         level);
/*      */     }
/*      */     
/* 1487 */     checkClosed();
/*      */     
/* 1489 */     switch (level) {
/*      */     case 0: 
/* 1491 */       this.m_connServAttr.trans_level = level;
/* 1492 */       break;
/*      */     
/*      */     case 2: 
/* 1495 */       DmdbCSI.setSessionIsoLevel(1, this);
/* 1496 */       this.m_connServAttr.trans_level = 2;
/* 1497 */       break;
/*      */     
/*      */     case 8: 
/* 1500 */       DmdbCSI.setSessionIsoLevel(3, this);
/* 1501 */       this.m_connServAttr.trans_level = 8;
/* 1502 */       break;
/*      */     
/*      */     case 1: 
/* 1505 */       DmdbCSI.setSessionIsoLevel(3, this);
/* 1506 */       this.m_connServAttr.trans_level = 1;
/* 1507 */       break;
/*      */     
/*      */ 
/*      */     case 3: 
/*      */     case 4: 
/*      */     case 5: 
/*      */     case 6: 
/*      */     case 7: 
/*      */     default: 
/* 1516 */       DBError.throwSQLException(6038);
/*      */     }
/*      */     
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public int getTransactionIsolation()
/*      */     throws SQLException
/*      */   {
/* 1536 */     if (Const.TRACE_LEVEL > 0) {
/* 1537 */       DmdbLog.trace(this, "getTransactionIsolation()", "");
/*      */     }
/*      */     
/* 1540 */     return this.m_connServAttr.trans_level;
/*      */   }
/*      */   
/*      */   /* Error */
/*      */   public SQLWarning getWarnings()
/*      */     throws SQLException
/*      */   {
/*      */     // Byte code:
/*      */     //   0: getstatic 325	dm/jdbc/dbaccess/Const:TRACE_LEVEL	I
/*      */     //   3: ifle +13 -> 16
/*      */     //   6: aload_0
/*      */     //   7: ldc_w 960
/*      */     //   10: ldc_w 330
/*      */     //   13: invokestatic 332	dm/jdbc/driver/DmdbLog:trace	(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)V
/*      */     //   16: aload_0
/*      */     //   17: invokevirtual 751	dm/jdbc/driver/DmdbConnection_bs:checkClosed	()V
/*      */     //   20: aload_0
/*      */     //   21: getfield 291	dm/jdbc/driver/DmdbConnection_bs:m_warning	Ljava/sql/SQLWarning;
/*      */     //   24: ifnull +20 -> 44
/*      */     //   27: aload_0
/*      */     //   28: getfield 291	dm/jdbc/driver/DmdbConnection_bs:m_warning	Ljava/sql/SQLWarning;
/*      */     //   31: dup
/*      */     //   32: astore_1
/*      */     //   33: monitorenter
/*      */     //   34: aload_0
/*      */     //   35: getfield 291	dm/jdbc/driver/DmdbConnection_bs:m_warning	Ljava/sql/SQLWarning;
/*      */     //   38: aload_1
/*      */     //   39: monitorexit
/*      */     //   40: areturn
/*      */     //   41: aload_1
/*      */     //   42: monitorexit
/*      */     //   43: athrow
/*      */     //   44: aconst_null
/*      */     //   45: areturn
/*      */     // Line number table:
/*      */     //   Java source line #1564	-> byte code offset #0
/*      */     //   Java source line #1565	-> byte code offset #6
/*      */     //   Java source line #1567	-> byte code offset #16
/*      */     //   Java source line #1569	-> byte code offset #20
/*      */     //   Java source line #1570	-> byte code offset #27
/*      */     //   Java source line #1571	-> byte code offset #34
/*      */     //   Java source line #1570	-> byte code offset #41
/*      */     //   Java source line #1575	-> byte code offset #44
/*      */     // Local variable table:
/*      */     //   start	length	slot	name	signature
/*      */     //   0	46	0	this	DmdbConnection_bs
/*      */     //   32	10	1	Ljava/lang/Object;	Object
/*      */     // Exception table:
/*      */     //   from	to	target	type
/*      */     //   34	40	41	finally
/*      */     //   41	43	41	finally
/*      */   }
/*      */   
/*      */   public void clearWarnings()
/*      */     throws SQLException
/*      */   {
/* 1589 */     if (Const.TRACE_LEVEL > 0) {
/* 1590 */       DmdbLog.trace(this, "clearWarnings()", "");
/*      */     }
/*      */     
/* 1593 */     if (this.m_warning != null) {
/* 1594 */       synchronized (this.m_warning) {
/* 1595 */         this.m_warning = null;
/*      */       }
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   private void addWarningsExec(SQLWarning warn)
/*      */   {
/* 1609 */     if (this.m_warning == null) {
/* 1610 */       this.m_warning = warn;
/*      */     } else {
/* 1612 */       this.m_warning.setNextWarning(warn);
/*      */     }
/*      */   }
/*      */   
/*      */   public void addWarnings(SQLWarning warn) {
/* 1617 */     if (warn != null) {
/* 1618 */       addWarningsExec(warn);
/*      */     }
/*      */   }
/*      */   
/*      */   void add_statement(long handle, Statement statement) {
/* 1623 */     this.statement_table.put(new Long(handle), statement);
/*      */   }
/*      */   
/*      */   void remove_statement(long handle)
/*      */   {
/* 1628 */     this.statement_table.remove(new Long(handle));
/*      */   }
/*      */   
/*      */   void close_all_resultSet() throws SQLException
/*      */   {
/* 1633 */     for (Enumeration e = this.statement_table.elements(); e.hasMoreElements();) {
/* 1634 */       DmdbStatement_bs stmt = (DmdbStatement_bs)e.nextElement();
/* 1635 */       if (stmt.currentRs != null) {
/* 1636 */         stmt.currentRs.close();
/*      */       }
/*      */     }
/*      */   }
/*      */   
/*      */   public long getCurpos(long handle) throws SQLException {
/* 1642 */     long curPos = 0L;
/*      */     
/* 1644 */     if (this.statement_table.containsKey(new Long(handle))) {
/* 1645 */       DmdbStatement_bs stmt = (DmdbStatement_bs)this.statement_table
/* 1646 */         .get(new Long(handle));
/* 1647 */       if (stmt == null) {
/* 1648 */         return curPos;
/*      */       }
/*      */       
/* 1651 */       DmdbResultSet_bs rs = (DmdbResultSet_bs)stmt
/* 1652 */         .getResultSet();
/*      */       
/* 1654 */       if (rs == null) {
/* 1655 */         return curPos;
/*      */       }
/*      */       
/* 1658 */       curPos = rs.getCurrentRowNum();
/*      */     }
/*      */     
/* 1661 */     return curPos;
/*      */   }
/*      */   
/*      */   private void close_statements() throws SQLException {
/* 1665 */     Enumeration enumeration = this.statement_table.elements();
/* 1666 */     while (enumeration.hasMoreElements()) {
/* 1667 */       DmdbStatement_bs stmt = (DmdbStatement_bs)enumeration
/* 1668 */         .nextElement();
/* 1669 */       if (stmt != null) {
/*      */         try {
/* 1671 */           stmt.close();
/*      */         }
/*      */         catch (Exception localException) {}
/*      */         
/* 1675 */         remove_statement(stmt.handle);
/* 1676 */         stmt = null;
/*      */       }
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized Statement createStatement(int resultSetType, int resultSetConcurrency)
/*      */     throws SQLException
/*      */   {
/* 1710 */     if (Const.TRACE_LEVEL > 0) {
/* 1711 */       DmdbLog.trace(this, "createStatement(int, int)", "resultSetType = " + 
/* 1712 */         resultSetType + "resultSetConcurrency = " + 
/* 1713 */         resultSetConcurrency);
/*      */     }
/*      */     
/* 1716 */     DmdbStatement_bs dmStatement = null;
/*      */     
/* 1718 */     clearWarnings();
/* 1719 */     checkClosed();
/*      */     
/*      */ 
/* 1722 */     if (!checkResultSetType(resultSetType, resultSetConcurrency, this.connectionHoldability)) {
/* 1723 */       DBError.throwSQLException(6065);
/*      */     }
/*      */     
/* 1726 */     if (resultSetType == 1005) {
/* 1727 */       addWarnings(new SQLWarning(
/* 1728 */         this.res.getString("warn.notSupportedResultType")));
/*      */       
/*      */ 
/* 1731 */       resultSetType = 1004;
/*      */     }
/*      */     
/* 1734 */     if (this.stmtPool.size() > 0) {
/* 1735 */       dmStatement = getFromStmtPool();
/* 1736 */       dmStatement.initializeReuseStmt(this);
/* 1737 */       dmStatement.resultSetType = resultSetType;
/* 1738 */       dmStatement.resultSetConcurrency = resultSetConcurrency;
/* 1739 */       dmStatement.resultSetHoldability = this.connectionHoldability;
/*      */     }
/*      */     else {
/* 1742 */       dmStatement = new DmdbStatement_bs(this, resultSetType, 
/* 1743 */         resultSetConcurrency, this.connectionHoldability);
/*      */     }
/*      */     
/*      */ 
/* 1747 */     addStmt(dmStatement);
/*      */     
/* 1749 */     return dmStatement;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
/*      */     throws SQLException
/*      */   {
/* 1783 */     return prepareStatement(sql, resultSetType, resultSetConcurrency, 
/* 1784 */       this.connectionHoldability);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
/*      */     throws SQLException
/*      */   {
/* 1818 */     return prepareCall(sql, resultSetType, resultSetConcurrency, 
/* 1819 */       this.connectionHoldability);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public Map getTypeMap()
/*      */     throws SQLException
/*      */   {
/* 1836 */     return this.m_typeMap;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void setTypeMap(Map map)
/*      */     throws SQLException
/*      */   {
/* 1855 */     this.m_typeMap = map;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void setHoldability(int holdability)
/*      */     throws SQLException
/*      */   {
/* 1878 */     if (Const.TRACE_LEVEL > 0) {
/* 1879 */       DmdbLog.trace(this, "setHoldability(int)", "holdability = " + 
/* 1880 */         holdability);
/*      */     }
/*      */     
/* 1883 */     if ((holdability == 1) || 
/* 1884 */       (holdability == 2)) {
/* 1885 */       this.connectionHoldability = holdability;
/*      */     } else {
/* 1887 */       DBError.throwSQLException(6055);
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public int getHoldability()
/*      */     throws SQLException
/*      */   {
/* 1905 */     if (Const.TRACE_LEVEL > 0) {
/* 1906 */       DmdbLog.trace(this, "getHoldability()", "");
/*      */     }
/*      */     
/* 1909 */     return this.connectionHoldability;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized Savepoint setSavepoint()
/*      */     throws SQLException
/*      */   {
/* 1925 */     if (Const.TRACE_LEVEL > 0) {
/* 1926 */       DmdbLog.trace(this, "setSavepoint()", "");
/*      */     }
/*      */     
/* 1929 */     checkClosed();
/* 1930 */     if (this.m_connStrAttr.auto_commit) {
/* 1931 */       DBError.throwSQLException(6039);
/*      */     }
/* 1933 */     DmdbSavepoint savepoint = new DmdbSavepoint();
/* 1934 */     String s = "SAVEPOINT DMDB_SVPT_" + savepoint.getSavepointId();
/*      */     
/* 1936 */     if (this.svptStmt == null) {
/* 1937 */       this.svptStmt = createStatement(1003, 
/* 1938 */         1007, 
/* 1939 */         1);
/*      */     }
/* 1941 */     this.svptStmt.executeUpdate(s);
/*      */     
/* 1943 */     return savepoint;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized Savepoint setSavepoint(String name)
/*      */     throws SQLException
/*      */   {
/* 1962 */     if (Const.TRACE_LEVEL > 0) {
/* 1963 */       DmdbLog.trace(this, "setSavepoint(String)", "name = " + name);
/*      */     }
/*      */     
/* 1966 */     checkClosed();
/* 1967 */     if (this.m_connStrAttr.auto_commit) {
/* 1968 */       DBError.throwSQLException(6039);
/*      */     }
/* 1970 */     if ((name == null) || (name.trim().length() == 0)) {
/* 1971 */       DBError.throwSQLException(6051);
/*      */     }
/* 1973 */     DmdbSavepoint savepoint = new DmdbSavepoint(name);
/* 1974 */     String s = "SAVEPOINT \"" + StringUtil.getEscObjName(name) + "\"";
/*      */     
/* 1976 */     if (this.svptStmt == null) {
/* 1977 */       this.svptStmt = createStatement(1003, 
/* 1978 */         1007, 
/* 1979 */         1);
/*      */     }
/* 1981 */     this.svptStmt.executeUpdate(s);
/*      */     
/* 1983 */     return savepoint;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void rollback(Savepoint savepoint)
/*      */     throws SQLException
/*      */   {
/* 2005 */     if (Const.TRACE_LEVEL > 0) {
/* 2006 */       DmdbLog.trace(this, "rollback(Savepoint)", "");
/*      */     }
/*      */     
/* 2009 */     checkClosed();
/* 2010 */     if (this.m_connStrAttr.auto_commit) {
/* 2011 */       if (this.m_connStrAttr.alwayseAllowCommit) {
/* 2012 */         return;
/*      */       }
/* 2014 */       DBError.throwSQLException(6043);
/*      */     }
/* 2016 */     if (savepoint == null) {
/* 2017 */       DBError.throwSQLException(6064);
/*      */     }
/* 2019 */     if (((DmdbSavepoint)savepoint).getReleasedFlag()) {
/* 2020 */       DBError.throwSQLException(6053);
/*      */     }
/*      */     
/* 2023 */     String s = "ROLLBACK TO SAVEPOINT \"";
/*      */     try {
/* 2025 */       s = s + StringUtil.getEscObjName(savepoint.getSavepointName());
/* 2026 */       s = s + "\"";
/*      */     } catch (SQLException sqlexception) {
/* 2028 */       s = s + "DMDB_SVPT_" + savepoint.getSavepointId();
/* 2029 */       s = s + "\"";
/*      */     }
/*      */     
/* 2032 */     if (this.svptStmt == null) {
/* 2033 */       this.svptStmt = createStatement(1003, 
/* 2034 */         1007, 
/* 2035 */         1);
/*      */     }
/* 2037 */     this.svptStmt.executeUpdate(s);
/* 2038 */     setTransReadonly(true);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized void releaseSavepoint(Savepoint savepoint)
/*      */     throws SQLException
/*      */   {
/* 2056 */     if (Const.TRACE_LEVEL > 0) {
/* 2057 */       DmdbLog.trace(this, "rollback(Savepoint)", "");
/*      */     }
/* 2059 */     checkClosed();
/*      */     
/* 2061 */     if (this.m_connStrAttr.auto_commit) {
/* 2062 */       DBError.throwSQLException(6041);
/*      */     }
/* 2064 */     if (savepoint == null) {
/* 2065 */       DBError.throwSQLException(6064);
/*      */     }
/* 2067 */     ((DmdbSavepoint)savepoint).setReleasedFlagTrue();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
/*      */     throws SQLException
/*      */   {
/* 2113 */     if (Const.TRACE_LEVEL > 0) {
/* 2114 */       DmdbLog.trace(this, "createStatement(int, int)", "resultSetType = " + 
/* 2115 */         resultSetType + ",resultSetConcurrency = " + 
/* 2116 */         resultSetConcurrency + ",resultSetHoldability = " + 
/* 2117 */         resultSetHoldability);
/*      */     }
/*      */     
/* 2120 */     DmdbStatement_bs dmStatement = null;
/*      */     
/* 2122 */     clearWarnings();
/* 2123 */     checkClosed();
/*      */     
/*      */ 
/* 2126 */     if (!checkResultSetType(resultSetType, resultSetConcurrency, resultSetHoldability)) {
/* 2127 */       DBError.throwSQLException(6065);
/*      */     }
/*      */     
/* 2130 */     if (resultSetType == 1005) {
/* 2131 */       addWarnings(new SQLWarning(
/* 2132 */         this.res.getString("warn.notSupportedResultType")));
/*      */       
/*      */ 
/* 2135 */       resultSetType = 1004;
/*      */     }
/*      */     
/* 2138 */     if (this.stmtPool.size() > 0) {
/* 2139 */       dmStatement = getFromStmtPool();
/* 2140 */       dmStatement.initializeReuseStmt(this);
/* 2141 */       dmStatement.resultSetType = resultSetType;
/* 2142 */       dmStatement.resultSetConcurrency = resultSetConcurrency;
/* 2143 */       dmStatement.resultSetHoldability = resultSetHoldability;
/*      */     } else {
/* 2145 */       dmStatement = new DmdbStatement_bs(this, resultSetType, 
/* 2146 */         resultSetConcurrency, resultSetHoldability);
/*      */     }
/*      */     
/*      */ 
/* 2150 */     addStmt(dmStatement);
/*      */     
/* 2152 */     return dmStatement;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
/*      */     throws SQLException
/*      */   {
/* 2196 */     DmdbPreparedStatement_bs pstmt = null;
/*      */     
/* 2198 */     if ((sql == null) || (sql.length() == 0)) {
/* 2199 */       DBError.throwSQLException(6003);
/*      */     }
/* 2201 */     if (Const.TRACE_LEVEL > 0) {
/* 2202 */       DmdbLog.trace(this, "prepareStatement(String, int, int, int)", 
/* 2203 */         "sql = " + sql + ", resultSetType = " + resultSetType + 
/* 2204 */         ", resultSetConcurrency = " + 
/* 2205 */         resultSetConcurrency + 
/* 2206 */         ", resultSetHoldability = " + 
/* 2207 */         resultSetHoldability);
/*      */     }
/*      */     
/*      */ 
/* 2211 */     if (!checkResultSetType(resultSetType, resultSetConcurrency, resultSetHoldability)) {
/* 2212 */       DBError.throwSQLException(6065);
/*      */     }
/*      */     
/* 2215 */     if (resultSetType == 1005) {
/* 2216 */       addWarnings(new SQLWarning(
/* 2217 */         this.res.getString("warn.notSupportedResultType")));
/*      */       
/*      */ 
/* 2220 */       resultSetType = 1004;
/*      */     }
/*      */     
/* 2223 */     checkClosed();
/*      */     
/* 2225 */     pstmt = getFromPreparedStmtPool(sql);
/* 2226 */     if (pstmt != null) {
/* 2227 */       pstmt.initializeReusePreparedStmt(this, sql);
/* 2228 */       pstmt.resultSetType = resultSetType;
/* 2229 */       pstmt.resultSetConcurrency = resultSetConcurrency;
/* 2230 */       pstmt.resultSetHoldability = resultSetHoldability;
/*      */     } else {
/* 2232 */       pstmt = new DmdbPreparedStatement_bs(this, sql, resultSetType, 
/* 2233 */         resultSetConcurrency, resultSetHoldability);
/*      */     }
/*      */     
/*      */ 
/* 2237 */     addStmt(pstmt);
/*      */     
/* 2239 */     return pstmt;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
/*      */     throws SQLException
/*      */   {
/* 2280 */     DmdbCallableStatement_bs cstmt = null;
/*      */     
/* 2282 */     if ((sql == null) || (sql.length() == 0)) {
/* 2283 */       DBError.throwSQLException(6003);
/*      */     }
/* 2285 */     if (Const.TRACE_LEVEL > 0) {
/* 2286 */       DmdbLog.trace(this, "prepareCall(String, int, int, int)", "sql = " + 
/* 2287 */         sql + ", resultSetType = " + resultSetType + 
/* 2288 */         ", resultSetConcurrency = " + resultSetConcurrency + 
/* 2289 */         ", resultSetHoldability = " + resultSetHoldability);
/*      */     }
/*      */     
/*      */ 
/* 2293 */     if (!checkResultSetType(resultSetType, resultSetConcurrency, resultSetHoldability)) {
/* 2294 */       DBError.throwSQLException(6065);
/*      */     }
/*      */     
/* 2297 */     if (resultSetType == 1005) {
/* 2298 */       addWarnings(new SQLWarning(
/* 2299 */         this.res.getString("warn.notSupportedResultType")));
/*      */       
/*      */ 
/* 2302 */       resultSetType = 1004;
/*      */     }
/*      */     
/* 2305 */     cstmt = getFromCallableStmtPool(sql);
/* 2306 */     if (cstmt != null) {
/* 2307 */       cstmt.initializeReuseCallableStmt(this, sql);
/* 2308 */       cstmt.resultSetType = resultSetType;
/* 2309 */       cstmt.resultSetConcurrency = resultSetConcurrency;
/* 2310 */       cstmt.resultSetHoldability = resultSetHoldability;
/*      */     } else {
/* 2312 */       cstmt = new DmdbCallableStatement_bs(this, sql, resultSetType, 
/* 2313 */         resultSetConcurrency, resultSetHoldability);
/*      */     }
/*      */     
/* 2316 */     addStmt(cstmt);
/*      */     
/* 2318 */     return cstmt;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
/*      */     throws SQLException
/*      */   {
/* 2360 */     DmdbPreparedStatement_bs pstmt = null;
/*      */     
/* 2362 */     if ((sql == null) || (sql.length() == 0)) {
/* 2363 */       DBError.throwSQLException(6003);
/*      */     }
/* 2365 */     if (Const.TRACE_LEVEL > 0) {
/* 2366 */       DmdbLog.trace(this, "prepareStatement(String, int)", "sql = " + sql + 
/* 2367 */         ", autoGeneratedKeys = " + autoGeneratedKeys);
/*      */     }
/*      */     
/* 2370 */     checkClosed();
/*      */     
/* 2372 */     pstmt = getFromPreparedStmtPool(sql);
/* 2373 */     if (pstmt != null) {
/* 2374 */       pstmt.initializeReusePreparedStmt(this, sql);
/* 2375 */       pstmt.resultSetType = this.m_connStrAttr.resultSetType;
/* 2376 */       pstmt.resultSetConcurrency = 1007;
/* 2377 */       pstmt.resultSetHoldability = this.connectionHoldability;
/*      */     } else {
/* 2379 */       pstmt = new DmdbPreparedStatement_bs(this, sql, 
/* 2380 */         this.m_connStrAttr.resultSetType, 1007, 
/* 2381 */         this.connectionHoldability, autoGeneratedKeys);
/*      */     }
/*      */     
/*      */ 
/* 2385 */     addStmt(pstmt);
/*      */     
/* 2387 */     return pstmt;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized PreparedStatement prepareStatement(String sql, int[] columnIndexes)
/*      */     throws SQLException
/*      */   {
/* 2432 */     DmdbPreparedStatement_bs pstmt = null;
/*      */     
/* 2434 */     if ((sql == null) || (sql.length() == 0)) {
/* 2435 */       DBError.throwSQLException(6003);
/*      */     }
/* 2437 */     StringBuffer indexStr = new StringBuffer("sql = " + sql);
/* 2438 */     indexStr.append(", columnIndexes = ");
/*      */     
/* 2440 */     if ((columnIndexes == null) || (columnIndexes.length <= 0)) {
/* 2441 */       indexStr.append("");
/*      */     } else {
/* 2443 */       for (int i = 0; i < columnIndexes.length; i++) {
/* 2444 */         if (i != 0) {
/* 2445 */           indexStr.append(", ");
/*      */         }
/* 2447 */         indexStr.append(columnIndexes[i]);
/*      */       }
/*      */     }
/* 2450 */     if (Const.TRACE_LEVEL > 0) {
/* 2451 */       DmdbLog.trace(this, "prepareStatement(String, int[])", 
/* 2452 */         indexStr.substring(0, indexStr.length()));
/*      */     }
/*      */     
/* 2455 */     checkClosed();
/*      */     
/* 2457 */     pstmt = getFromPreparedStmtPool(sql);
/* 2458 */     if (pstmt != null) {
/* 2459 */       pstmt.initializeReusePreparedStmt(this, sql);
/* 2460 */       pstmt.resultSetType = this.m_connStrAttr.resultSetType;
/* 2461 */       pstmt.resultSetConcurrency = 1007;
/* 2462 */       pstmt.resultSetHoldability = this.connectionHoldability;
/*      */     } else {
/* 2464 */       pstmt = new DmdbPreparedStatement_bs(this, sql, 
/* 2465 */         this.m_connStrAttr.resultSetType, 1007, 
/* 2466 */         this.connectionHoldability, columnIndexes);
/*      */     }
/*      */     
/*      */ 
/* 2470 */     addStmt(pstmt);
/*      */     
/* 2472 */     return pstmt;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */   public synchronized PreparedStatement prepareStatement(String sql, String[] columnNames)
/*      */     throws SQLException
/*      */   {
/* 2517 */     DmdbPreparedStatement_bs pstmt = null;
/*      */     
/* 2519 */     if ((sql == null) || (sql.length() == 0)) {
/* 2520 */       DBError.throwSQLException(6003);
/*      */     }
/* 2522 */     StringBuffer indexStr = new StringBuffer("sql = " + sql);
/* 2523 */     indexStr.append(", columnIndexes = ");
/*      */     
/* 2525 */     if ((columnNames == null) || (columnNames.length <= 0)) {
/* 2526 */       indexStr.append("");
/*      */     } else
/* 2528 */       for (int i = 0; i < columnNames.length; i++) {
/* 2529 */         if (i != 0)
/* 2530 */           indexStr.append(", ");
/* 2531 */         if (columnNames[i] == null) {
/* 2532 */           indexStr.append("null");
/*      */         } else
/* 2534 */           indexStr.append(columnNames[i]);
/*      */       }
/* 2536 */     if (Const.TRACE_LEVEL > 0) {
/* 2537 */       DmdbLog.trace(this, "prepareStatement(String, String[])", 
/* 2538 */         indexStr.substring(0, indexStr.length()));
/*      */     }
/*      */     
/* 2541 */     checkClosed();
/*      */     
/* 2543 */     pstmt = getFromPreparedStmtPool(sql);
/* 2544 */     if (pstmt != null) {
/* 2545 */       pstmt.initializeReusePreparedStmt(this, sql);
/* 2546 */       pstmt.resultSetType = this.m_connStrAttr.resultSetType;
/* 2547 */       pstmt.resultSetConcurrency = 1007;
/* 2548 */       pstmt.resultSetHoldability = this.connectionHoldability;
/*      */     } else {
/* 2550 */       pstmt = new DmdbPreparedStatement_bs(this, sql, 
/* 2551 */         this.m_connStrAttr.resultSetType, 1007, 
/* 2552 */         this.connectionHoldability, columnNames);
/*      */     }
/*      */     
/*      */ 
/* 2556 */     addStmt(pstmt);
/*      */     
/* 2558 */     return pstmt;
/*      */   }
/*      */   
/*      */   /* Error */
/*      */   public String getExplainInfo(String sqlToExplain)
/*      */     throws SQLException
/*      */   {
/*      */     // Byte code:
/*      */     //   0: aconst_null
/*      */     //   1: astore_3
/*      */     //   2: aload_1
/*      */     //   3: ifnull +13 -> 16
/*      */     //   6: aload_1
/*      */     //   7: invokevirtual 239	java/lang/String:trim	()Ljava/lang/String;
/*      */     //   10: invokevirtual 161	java/lang/String:length	()I
/*      */     //   13: ifne +9 -> 22
/*      */     //   16: sipush 6003
/*      */     //   19: invokestatic 592	dm/jdbc/dbaccess/DBError:throwSQLException	(I)V
/*      */     //   22: aload_1
/*      */     //   23: ldc_w 1204
/*      */     //   26: invokevirtual 275	java/lang/String:equalsIgnoreCase	(Ljava/lang/String;)Z
/*      */     //   29: ifne +21 -> 50
/*      */     //   32: new 488	java/lang/StringBuffer
/*      */     //   35: dup
/*      */     //   36: ldc_w 1206
/*      */     //   39: invokespecial 492	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
/*      */     //   42: aload_1
/*      */     //   43: invokevirtual 496	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
/*      */     //   46: invokevirtual 507	java/lang/StringBuffer:toString	()Ljava/lang/String;
/*      */     //   49: astore_1
/*      */     //   50: aload_0
/*      */     //   51: invokevirtual 534	dm/jdbc/driver/DmdbConnection_bs:createStatement	()Ljava/sql/Statement;
/*      */     //   54: checkcast 538	dm/jdbc/driver/DmdbStatement_bs
/*      */     //   57: astore_2
/*      */     //   58: aload_2
/*      */     //   59: aload_1
/*      */     //   60: invokevirtual 1208	dm/jdbc/driver/DmdbStatement_bs:execute	(Ljava/lang/String;)Z
/*      */     //   63: pop
/*      */     //   64: aload_2
/*      */     //   65: invokevirtual 1209	dm/jdbc/driver/DmdbStatement_bs:getDmdbInfo	()Ldm/jdbc/driver/DmdbInfo;
/*      */     //   68: invokevirtual 1213	dm/jdbc/driver/DmdbInfo:getExplain	()Ljava/lang/String;
/*      */     //   71: astore_3
/*      */     //   72: goto +17 -> 89
/*      */     //   75: astore 4
/*      */     //   77: aload 4
/*      */     //   79: athrow
/*      */     //   80: astore 5
/*      */     //   82: aload_2
/*      */     //   83: invokevirtual 546	dm/jdbc/driver/DmdbStatement_bs:close	()V
/*      */     //   86: aload 5
/*      */     //   88: athrow
/*      */     //   89: aload_2
/*      */     //   90: invokevirtual 546	dm/jdbc/driver/DmdbStatement_bs:close	()V
/*      */     //   93: aload_3
/*      */     //   94: areturn
/*      */     // Line number table:
/*      */     //   Java source line #2571	-> byte code offset #0
/*      */     //   Java source line #2573	-> byte code offset #2
/*      */     //   Java source line #2574	-> byte code offset #16
/*      */     //   Java source line #2576	-> byte code offset #22
/*      */     //   Java source line #2577	-> byte code offset #32
/*      */     //   Java source line #2579	-> byte code offset #50
/*      */     //   Java source line #2581	-> byte code offset #58
/*      */     //   Java source line #2583	-> byte code offset #64
/*      */     //   Java source line #2584	-> byte code offset #72
/*      */     //   Java source line #2585	-> byte code offset #77
/*      */     //   Java source line #2586	-> byte code offset #80
/*      */     //   Java source line #2587	-> byte code offset #82
/*      */     //   Java source line #2588	-> byte code offset #86
/*      */     //   Java source line #2587	-> byte code offset #89
/*      */     //   Java source line #2589	-> byte code offset #93
/*      */     // Local variable table:
/*      */     //   start	length	slot	name	signature
/*      */     //   0	95	0	this	DmdbConnection_bs
/*      */     //   0	95	1	sqlToExplain	String
/*      */     //   57	33	2	stmt	DmdbStatement_bs
/*      */     //   1	93	3	explainInfo	String
/*      */     //   75	3	4	e	SQLException
/*      */     //   80	7	5	localObject	Object
/*      */     // Exception table:
/*      */     //   from	to	target	type
/*      */     //   58	72	75	java/sql/SQLException
/*      */     //   58	80	80	finally
/*      */   }
/*      */   
/*      */   /* Error */
/*      */   public String getSessionTrace(String sql)
/*      */     throws SQLException
/*      */   {
/*      */     // Byte code:
/*      */     //   0: aload_0
/*      */     //   1: invokevirtual 534	dm/jdbc/driver/DmdbConnection_bs:createStatement	()Ljava/sql/Statement;
/*      */     //   4: checkcast 538	dm/jdbc/driver/DmdbStatement_bs
/*      */     //   7: astore_2
/*      */     //   8: aload_2
/*      */     //   9: aload_1
/*      */     //   10: invokevirtual 1221	dm/jdbc/driver/DmdbStatement_bs:executeUpdate	(Ljava/lang/String;)I
/*      */     //   13: pop
/*      */     //   14: aload_2
/*      */     //   15: invokevirtual 1222	dm/jdbc/driver/DmdbStatement_bs:getExplain	()Ljava/lang/String;
/*      */     //   18: astore_3
/*      */     //   19: goto +17 -> 36
/*      */     //   22: astore 4
/*      */     //   24: aload 4
/*      */     //   26: athrow
/*      */     //   27: astore 5
/*      */     //   29: aload_2
/*      */     //   30: invokevirtual 546	dm/jdbc/driver/DmdbStatement_bs:close	()V
/*      */     //   33: aload 5
/*      */     //   35: athrow
/*      */     //   36: aload_2
/*      */     //   37: invokevirtual 546	dm/jdbc/driver/DmdbStatement_bs:close	()V
/*      */     //   40: aload_3
/*      */     //   41: areturn
/*      */     // Line number table:
/*      */     //   Java source line #2596	-> byte code offset #0
/*      */     //   Java source line #2598	-> byte code offset #8
/*      */     //   Java source line #2599	-> byte code offset #14
/*      */     //   Java source line #2601	-> byte code offset #19
/*      */     //   Java source line #2602	-> byte code offset #24
/*      */     //   Java source line #2603	-> byte code offset #27
/*      */     //   Java source line #2604	-> byte code offset #29
/*      */     //   Java source line #2605	-> byte code offset #33
/*      */     //   Java source line #2604	-> byte code offset #36
/*      */     //   Java source line #2607	-> byte code offset #40
/*      */     // Local variable table:
/*      */     //   start	length	slot	name	signature
/*      */     //   0	42	0	this	DmdbConnection_bs
/*      */     //   0	42	1	sql	String
/*      */     //   7	30	2	stmt	DmdbStatement_bs
/*      */     //   18	2	3	retstr	String
/*      */     //   36	5	3	retstr	String
/*      */     //   22	3	4	e	SQLException
/*      */     //   27	7	5	localObject	Object
/*      */     // Exception table:
/*      */     //   from	to	target	type
/*      */     //   8	19	22	java/sql/SQLException
/*      */     //   8	27	27	finally
/*      */   }
/*      */   
/*      */   public final boolean getDDL_Autocommit()
/*      */     throws SQLException
/*      */   {
/* 2616 */     return this.m_connServAttr.ddl_auto_commit;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public final void setDDL_Autocommit(boolean autoCommit)
/*      */     throws SQLException
/*      */   {
/* 2625 */     DmdbStatement_bs stmt = (DmdbStatement_bs)createStatement(
/* 2626 */       1003, 1007, 
/* 2627 */       1);
/*      */     
/* 2629 */     if (autoCommit) {
/* 2630 */       stmt.executeQuery("SELECT DM_SET_SESSION_AUTOCMT(1)", 1);
/* 2631 */       this.m_connServAttr.ddl_auto_commit = true;
/*      */     } else {
/* 2633 */       stmt.executeQuery("SELECT DM_SET_SESSION_AUTOCMT(0)", 1);
/* 2634 */       this.m_connServAttr.ddl_auto_commit = false;
/*      */     }
/*      */     
/* 2637 */     stmt.close();
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public DbAccess getDbAccess()
/*      */   {
/* 2645 */     return this.m_dbaccess;
/*      */   }
/*      */   
/*      */   public void setDbAccess(DbAccess dbaccess) {
/* 2649 */     this.m_dbaccess = dbaccess;
/*      */   }
/*      */   
/*      */   public DmdbSwitch getDbSwitch() {
/* 2653 */     return this.m_switch;
/*      */   }
/*      */   
/*      */   public AuthInfo getKerberosAuth() {
/* 2657 */     if (this.m_dbaccess != null) {
/* 2658 */       return this.m_dbaccess.getAuthInfo();
/*      */     }
/* 2660 */     return null;
/*      */   }
/*      */   
/*      */   public DmMsgSend getMsg() throws SQLException {
/* 2664 */     synchronized (this.msgMutex) {
/* 2665 */       while (!this.m_msgRelease) {
/*      */         try
/*      */         {
/* 2668 */           Thread.sleep(3L);
/*      */         }
/*      */         catch (InterruptedException localInterruptedException) {}
/*      */       }
/*      */       
/* 2673 */       this.m_msgRelease = false;
/* 2674 */       return this.m_msg;
/*      */     }
/*      */   }
/*      */   
/*      */   public void returnMsg() {
/* 2679 */     this.m_msgRelease = true;
/*      */   }
/*      */   
/*      */   public void reset() throws SQLException
/*      */   {
/* 2684 */     if (this.m_dbaccess != null) {
/* 2685 */       this.m_dbaccess.reset();
/*      */       
/* 2687 */       invalidAllStmt();
/*      */       
/* 2689 */       openConnection();
/*      */     }
/*      */   }
/*      */   
/*      */   private void addStmt(Statement stmt) {
/* 2694 */     this.stmtsVec.add(stmt);
/*      */   }
/*      */   
/*      */   public void delStmt(Statement stmt) {
/* 2698 */     if ((this.stmtsVec == null) || (this.stmtsVec.isEmpty())) {
/* 2699 */       return;
/*      */     }
/* 2701 */     this.stmtsVec.remove(stmt);
/*      */   }
/*      */   
/*      */   private void invalidAllStmt() {
/* 2705 */     DmdbStatement_bs stmt = null;
/*      */     
/* 2707 */     if ((this.stmtsVec == null) || (this.stmtsVec.isEmpty())) {
/* 2708 */       return;
/*      */     }
/*      */     try {
/* 2711 */       for (int i = 0; i < this.stmtsVec.size(); i++) {
/* 2712 */         stmt = (DmdbStatement_bs)this.stmtsVec.get(i);
/*      */         
/* 2714 */         if ((stmt != null) && (!stmt.closed)) {
/* 2715 */           stmt.closeSimple();
/*      */         }
/*      */       }
/*      */     }
/*      */     catch (NoSuchElementException localNoSuchElementException) {}
/*      */     
/* 2721 */     this.stmtsVec.clear();
/*      */   }
/*      */   
/*      */   final ArrayList getHosts() {
/* 2725 */     return this.m_servList;
/*      */   }
/*      */   
/*      */   void setServPos(int pos) {
/* 2729 */     this.m_servPos = pos;
/*      */   }
/*      */   
/*      */   int getServPos() {
/* 2733 */     return this.m_servPos;
/*      */   }
/*      */   
/*      */   public boolean hasOneSvr() {
/* 2737 */     return this.m_servList.size() == 1;
/*      */   }
/*      */   
/*      */   public int getStmtPoolSize() {
/* 2741 */     return this.stmtPool.size();
/*      */   }
/*      */   
/*      */   public void addToStmtPool(DmdbStatement_bs stmt) {
/* 2745 */     this.stmtPool.add(stmt);
/*      */   }
/*      */   
/*      */   public DmdbStatement_bs getFromStmtPool() {
/* 2749 */     DmdbStatement_bs stmt = (DmdbStatement_bs)this.stmtPool.firstElement();
/* 2750 */     this.stmtPool.remove(0);
/* 2751 */     return stmt;
/*      */   }
/*      */   
/*      */   public void addToPreparedStmtPool(DmdbPreparedStatement_bs pstmt) {
/* 2755 */     if (this.preparedStmtPoolArray.size() >= getStmtPoolMaxSize()) {
/* 2756 */       DmdbPreparedStatement_bs pstmt2 = (DmdbPreparedStatement_bs)this.preparedStmtPoolArray
/* 2757 */         .remove(0);
/* 2758 */       this.preparedStmtPool.remove(pstmt2.originalSql);
/*      */       try {
/* 2760 */         pstmt2.innerClose();
/*      */       }
/*      */       catch (SQLException localSQLException) {}
/*      */     }
/* 2764 */     this.preparedStmtPool.put(pstmt.originalSql, pstmt);
/* 2765 */     this.preparedStmtPoolArray.add(pstmt);
/*      */   }
/*      */   
/*      */   public DmdbPreparedStatement_bs getFromPreparedStmtPool(String sql) {
/* 2769 */     DmdbPreparedStatement_bs pstmt = (DmdbPreparedStatement_bs)this.preparedStmtPool
/* 2770 */       .get(sql);
/* 2771 */     if (pstmt != null) {
/* 2772 */       this.preparedStmtPool.remove(sql);
/* 2773 */       this.preparedStmtPoolArray.remove(pstmt);
/*      */     }
/* 2775 */     return pstmt;
/*      */   }
/*      */   
/*      */   public void addToCallableStmtPool(DmdbCallableStatement_bs cstmt) {
/* 2779 */     if (this.callableStmtPool.size() >= getStmtPoolMaxSize()) {
/* 2780 */       DmdbCallableStatement_bs cstmt2 = (DmdbCallableStatement_bs)this.callableStmtPoolArray
/* 2781 */         .remove(0);
/* 2782 */       this.callableStmtPool.remove(cstmt2.originalSql);
/*      */       try {
/* 2784 */         cstmt2.innerClose();
/*      */       }
/*      */       catch (SQLException localSQLException) {}
/*      */     }
/* 2788 */     this.callableStmtPool.put(cstmt.originalSql, cstmt);
/* 2789 */     this.callableStmtPoolArray.add(cstmt);
/*      */   }
/*      */   
/*      */   public DmdbCallableStatement_bs getFromCallableStmtPool(String sql) {
/* 2793 */     DmdbCallableStatement_bs cstmt = (DmdbCallableStatement_bs)this.callableStmtPool
/* 2794 */       .get(sql);
/* 2795 */     if (cstmt != null) {
/* 2796 */       this.callableStmtPool.remove(sql);
/* 2797 */       this.callableStmtPoolArray.remove(cstmt);
/*      */     }
/* 2799 */     return cstmt;
/*      */   }
/*      */   
/*      */   private boolean checkResultSetType(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
/*      */   {
/* 2804 */     boolean checked = true;
/*      */     
/* 2806 */     switch (resultSetType) {
/*      */     case 1003: 
/*      */     case 1004: 
/*      */     case 1005: 
/*      */       break;
/*      */     default: 
/* 2812 */       return !checked;
/*      */     }
/*      */     
/* 2815 */     switch (resultSetConcurrency) {
/*      */     case 1007: 
/*      */     case 1008: 
/*      */       break;
/*      */     default: 
/* 2820 */       return !checked;
/*      */     }
/*      */     
/* 2823 */     switch (resultSetHoldability) {
/*      */     case 1: 
/*      */     case 2: 
/*      */       break;
/*      */     default: 
/* 2828 */       checked = false;
/*      */     }
/*      */     
/* 2831 */     return checked;
/*      */   }
/*      */   
/*      */   public int getStmtPoolMaxSize() {
/* 2835 */     return this.m_connStrAttr.stmtPoolSize;
/*      */   }
/*      */   
/*      */   public boolean getIgnoreCase() {
/* 2839 */     String value = this.m_clientInfoMapConnStr.getProperty("ignoreCase");
/* 2840 */     if (value == null) {
/* 2841 */       return this.m_connStrAttr.ignoreCase;
/*      */     }
/* 2843 */     return Boolean.valueOf(value).booleanValue();
/*      */   }
/*      */   
/*      */   public boolean getComOra() {
/* 2847 */     String value = this.m_clientInfoMapConnStr.getProperty("comOra");
/* 2848 */     if (value == null) {
/* 2849 */       return this.m_connStrAttr.comOra;
/*      */     }
/* 2851 */     return Boolean.valueOf(value).booleanValue();
/*      */   }
/*      */   
/*      */   protected int getBatchType() {
/* 2855 */     String value = this.m_clientInfoMapConnStr.getProperty("batchType");
/* 2856 */     if (value == null) {
/* 2857 */       return this.m_connStrAttr.batchType;
/*      */     }
/* 2859 */     return Integer.parseInt(value);
/*      */   }
/*      */   
/*      */   public final void setLanguage(int language) {
/* 2863 */     this.m_connServAttr.language = language;
/*      */   }
/*      */   
/*      */   public final int getLanguage() {
/* 2867 */     return this.m_connServAttr.language;
/*      */   }
/*      */   
/*      */   public final void setTransAccessMode(int accessMode) {
/* 2871 */     this.m_connServAttr.tranAccessMode = accessMode;
/*      */   }
/*      */   
/*      */   public final int getTransAccessMode() {
/* 2875 */     return this.m_connServAttr.tranAccessMode;
/*      */   }
/*      */   
/*      */   public void setTz(short tz) {
/* 2879 */     this.m_connServAttr.tz = tz;
/*      */     
/* 2881 */     this.m_cnvtInfo.setTimeZone(tz);
/*      */   }
/*      */   
/*      */   public short getTz() {
/* 2885 */     return this.m_connServAttr.tz;
/*      */   }
/*      */   
/*      */   public String getOsName() {
/* 2889 */     return this.m_connServAttr.osName;
/*      */   }
/*      */   
/*      */   public void setMaxRowSize(short maxRowSize) {
/* 2893 */     this.m_connServAttr.maxRowSize = maxRowSize;
/*      */   }
/*      */   
/*      */   public short getMaxRowSize() {
/* 2897 */     return this.m_connServAttr.maxRowSize;
/*      */   }
/*      */   
/*      */   public void setMaxSession(int maxSession) {
/* 2901 */     this.m_connServAttr.maxSession = maxSession;
/*      */   }
/*      */   
/*      */   public int getMaxSession() {
/* 2905 */     return this.m_connServAttr.maxSession;
/*      */   }
/*      */   
/*      */   public void setDDL_Auto_commit(boolean auto_commit) {
/* 2909 */     this.m_connServAttr.ddl_auto_commit = auto_commit;
/*      */   }
/*      */   
/*      */   public boolean getDDL_Auto_Commit() {
/* 2913 */     return this.m_connServAttr.ddl_auto_commit;
/*      */   }
/*      */   
/*      */   public void setTransLevel(int level) {
/* 2917 */     this.m_connServAttr.trans_level = level;
/*      */   }
/*      */   
/*      */   public int getTransLevel() {
/* 2921 */     return this.m_connServAttr.trans_level;
/*      */   }
/*      */   
/*      */   public void setCaseSensitive(boolean caseSensitive) {
/* 2925 */     this.m_connServAttr.caseSensitive = caseSensitive;
/*      */   }
/*      */   
/*      */   public boolean getCaseSensitive() {
/* 2929 */     return this.m_connServAttr.caseSensitive;
/*      */   }
/*      */   
/*      */   public void setBackslashEscape(boolean escape) {
/* 2933 */     this.m_connServAttr.backslash_escape = escape;
/*      */   }
/*      */   
/*      */   public boolean getBackslashEscape() {
/* 2937 */     return this.m_connServAttr.backslash_escape;
/*      */   }
/*      */   
/*      */   public void setSvrMode(int svrMode) {
/* 2941 */     this.m_connServAttr.svrMode = svrMode;
/*      */   }
/*      */   
/*      */   public int getSvrMode() {
/* 2945 */     return this.m_connServAttr.svrMode;
/*      */   }
/*      */   
/*      */   public void setSvrStat(int svrStat) {
/* 2949 */     this.m_connServAttr.svrStat = svrStat;
/*      */   }
/*      */   
/*      */   public int getSvrStat() {
/* 2953 */     return this.m_connServAttr.svrStat;
/*      */   }
/*      */   
/*      */   public void setConstParaOpt(byte opt) {
/* 2957 */     if (1 == opt) {
/* 2958 */       this.m_connServAttr.const_para_opt = true;
/*      */     } else
/* 2960 */       this.m_connServAttr.const_para_opt = false;
/*      */   }
/*      */   
/*      */   public boolean getConstParaOpt() {
/* 2964 */     return this.m_connServAttr.const_para_opt;
/*      */   }
/*      */   
/*      */   public void setDbTz(int tz) {
/* 2968 */     this.m_connServAttr.db_tz = tz;
/*      */     
/* 2970 */     this.m_cnvtInfo.setDbTz((short)tz);
/*      */   }
/*      */   
/*      */   public int getDbTz() {
/* 2974 */     return this.m_connServAttr.db_tz;
/*      */   }
/*      */   
/*      */   public void setInstanceName(String instName) {
/* 2978 */     this.m_connServAttr.instanceName = instName;
/*      */   }
/*      */   
/*      */   public String getInstanceName() {
/* 2982 */     return this.m_connServAttr.instanceName;
/*      */   }
/*      */   
/*      */   public void setSchema(String schema) {
/* 2986 */     this.m_connServAttr.schema = schema;
/*      */   }
/*      */   
/*      */   public String getSchema() {
/* 2990 */     return this.m_connServAttr.schema;
/*      */   }
/*      */   
/*      */   public void setLastLoginIP(String lastLoginIP) {
/* 2994 */     this.m_connServAttr.lastLoginIP = lastLoginIP;
/*      */   }
/*      */   
/*      */   public String getLastLoginIP() {
/* 2998 */     return this.m_connServAttr.lastLoginIP;
/*      */   }
/*      */   
/*      */   public void setLastLoginTime(String lastLoginTime) {
/* 3002 */     this.m_connServAttr.lastLoginTime = lastLoginTime;
/*      */   }
/*      */   
/*      */   public String getLastLoginTime() {
/* 3006 */     return this.m_connServAttr.lastLoginTime;
/*      */   }
/*      */   
/*      */   public void setFailedAttempt(int failedAttempt) {
/* 3010 */     this.m_connServAttr.failedAttempts = failedAttempt;
/*      */   }
/*      */   
/*      */   public int getFailedAttempt() {
/* 3014 */     return this.m_connServAttr.failedAttempts;
/*      */   }
/*      */   
/*      */   public void setLoginWarningID(int loginWarningID) {
/* 3018 */     this.m_connServAttr.loginWarningID = loginWarningID;
/*      */   }
/*      */   
/*      */   public int getLoginWarningID() {
/* 3022 */     return this.m_connServAttr.loginWarningID;
/*      */   }
/*      */   
/*      */   public void setGraceTimeRemainder(int gracetimeRemainder) {
/* 3026 */     this.m_connServAttr.gracetimeRemainder = gracetimeRemainder;
/*      */   }
/*      */   
/*      */   public int getGraceTimeRemainder() {
/* 3030 */     return this.m_connServAttr.gracetimeRemainder;
/*      */   }
/*      */   
/*      */   public void setEncryptMsg(int encryptMsg) {
/* 3034 */     this.m_connServAttr.encryptMsg = encryptMsg;
/*      */   }
/*      */   
/*      */   public int getEncryptMsg() {
/* 3038 */     return this.m_connServAttr.encryptMsg;
/*      */   }
/*      */   
/*      */   public boolean getIsExecute2() {
/* 3042 */     return this.m_isExecute2;
/*      */   }
/*      */   
/*      */   public void setDmServerVersion(String version) {
/* 3046 */     this.m_connServAttr.dmServerVersion = version;
/* 3047 */     this.m_isExecute2 = isExecute2(version, DmdbType.getGlobalVersion());
/*      */   }
/*      */   
/*      */   public final String getDmServerVersion() {
/* 3051 */     return this.m_connServAttr.dmServerVersion;
/*      */   }
/*      */   
/*      */   public void setGlobalServerSeries(int series) {
/* 3055 */     this.m_connServAttr.global_server_series = series;
/*      */   }
/*      */   
/*      */   public int getGlobalServerSeries() {
/* 3059 */     return this.m_connServAttr.global_server_series;
/*      */   }
/*      */   
/*      */   public void setServerEncoding(String serverEncoding) {
/* 3063 */     this.m_connServAttr.m_serverEncoding = serverEncoding;
/*      */     
/* 3065 */     this.m_cnvtInfo.setServerEncoding(serverEncoding);
/*      */   }
/*      */   
/*      */   public String getServerEncoding() {
/* 3069 */     return this.m_connServAttr.m_serverEncoding;
/*      */   }
/*      */   
/*      */   public void setComprMsg(int compr) {
/* 3073 */     this.m_connServAttr.comprMsg = compr;
/*      */   }
/*      */   
/*      */   public int getComprMsg() {
/* 3077 */     return this.m_connServAttr.comprMsg;
/*      */   }
/*      */   
/*      */   protected void setNetworkPacketSize(int packetSize) {
/* 3081 */     this.m_connServAttr.networkPacketSize = packetSize;
/*      */   }
/*      */   
/*      */   public int getNetworkPacketSize() {
/* 3085 */     return this.m_connServAttr.networkPacketSize;
/*      */   }
/*      */   
/*      */   public String getHostMchName()
/*      */   {
/* 3090 */     String hostName = "";
/*      */     try
/*      */     {
/* 3093 */       InetAddress ia = null;
/* 3094 */       ia = InetAddress.getLocalHost();
/* 3095 */       if (ia != null) {
/* 3096 */         hostName = ia.getHostName();
/*      */       }
/*      */     }
/*      */     catch (UnknownHostException localUnknownHostException) {}
/*      */     
/*      */ 
/* 3102 */     return hostName;
/*      */   }
/*      */   
/*      */   public CnvtInfo getCnvtInfo() {
/* 3106 */     return this.m_cnvtInfo;
/*      */   }
/*      */   
/*      */   private void initConnStrAttr(String url, String user, String pwd, String host, String port, Properties props)
/*      */   {
/* 3111 */     initDefaultClientInfo();
/*      */     
/* 3113 */     this.m_connStrAttr.url = url;
/* 3114 */     this.m_connStrAttr.login = user;
/* 3115 */     this.m_connStrAttr.password = pwd;
/* 3116 */     this.m_connStrAttr.host = host;
/* 3117 */     this.m_connStrAttr.port = Integer.parseInt(port);
/*      */     
/* 3119 */     String info = url + "->url;" + user + "->user;";
/* 3120 */     if (Const.TRACE_LEVEL > 0) {
/* 3121 */       DmdbLog.trace(this, "create Connection", info);
/*      */     }
/*      */     
/* 3124 */     if (props != null) {
/* 3125 */       this.m_connStrAttr.socketTimeout = Integer.parseInt(props.getProperty(
/* 3126 */         "socketTimeout", "0"));
/* 3127 */       this.m_connStrAttr.continueBatchOnError = Boolean.valueOf(
/* 3128 */         props.getProperty("continueBatchOnError", "false"))
/* 3129 */         .booleanValue();
/* 3130 */       this.m_connStrAttr.m_process_escapes = Boolean.valueOf(
/* 3131 */         props.getProperty("escapeProcess", "true")).booleanValue();
/* 3132 */       this.m_connStrAttr.maxRows = Integer.parseInt(props.getProperty(
/* 3133 */         "maxRows", "0"));
/* 3134 */       this.m_connStrAttr.default_row_prefetch = Integer.parseInt(props
/* 3135 */         .getProperty("rowPrefetch", "10"));
/* 3136 */       this.m_connStrAttr.auto_commit = Boolean.valueOf(
/* 3137 */         props.getProperty("autoCommit", "true")).booleanValue();
/* 3138 */       this.m_connStrAttr.maxCachedPstmtSize = Integer.parseInt(props
/* 3139 */         .getProperty("maxCachedPstmtSize", "0"));
/* 3140 */       this.m_connStrAttr.lob_mode = Integer.parseInt(props.getProperty(
/* 3141 */         "LobMode", "1"));
/* 3142 */       this.m_connStrAttr.stmtPoolSize = Integer.parseInt(props.getProperty(
/* 3143 */         "StmtPoolSize", "0"));
/* 3144 */       this.m_connStrAttr.ignoreCase = Boolean.valueOf(
/* 3145 */         props.getProperty("ignoreCase", "true")).booleanValue();
/* 3146 */       this.m_connStrAttr.comOra = Boolean.valueOf(
/* 3147 */         props.getProperty("comOra", "false")).booleanValue();
/* 3148 */       this.m_connStrAttr.infoLevel = Integer.parseInt(props.getProperty(
/* 3149 */         "infoLevel", "1"));
/* 3150 */       this.m_connStrAttr.alwayseAllowCommit = Boolean.valueOf(
/* 3151 */         props.getProperty("alwayseAllowCommit", "true"))
/* 3152 */         .booleanValue();
/* 3153 */       this.m_connStrAttr.batchType = Integer.parseInt(props.getProperty(
/* 3154 */         "batchType", "1"));
/* 3155 */       this.m_connStrAttr.traceLevel = Integer.parseInt(props.getProperty(
/* 3156 */         "traceLevel", "0"));
/* 3157 */       Const.TRACE_LEVEL = this.m_connStrAttr.traceLevel;
/* 3158 */       this.m_connStrAttr.appName = props.getProperty("appName", "");
/* 3159 */       this.m_connStrAttr.isCompress = Boolean.valueOf(props.getProperty(
/* 3160 */         "isCompress", "false")).booleanValue();
/* 3161 */       this.m_connStrAttr.sessionTimeout = Integer.parseInt(props.getProperty(
/* 3162 */         "sessionTimeout", "0"));
/* 3163 */       this.m_connStrAttr.connectTimeout = Integer.parseInt(props.getProperty(
/* 3164 */         "connectTimeout", "0"));
/* 3165 */       this.m_connStrAttr.sslFilesPath = props.getProperty("sslFilesPath", "");
/* 3166 */       this.m_connStrAttr.sslKeystorePass = props.getProperty(
/* 3167 */         "sslKeystorePass", "");
/* 3168 */       this.m_connStrAttr.resultSetType = Integer.parseInt(props.getProperty(
/* 3169 */         "resultSetType", 
/* 3170 */         String.valueOf(1003)));
/* 3171 */       this.m_connStrAttr.kerberosLoginConfPath = props.getProperty(
/* 3172 */         "kerberosLoginConfPath", "");
/* 3173 */       this.m_connStrAttr.mppLocal = Boolean.valueOf(
/* 3174 */         props.getProperty("mppLocal", "false")).booleanValue();
/* 3175 */       this.m_connStrAttr.rwSeparate = Integer.parseInt(props.getProperty(
/* 3176 */         "rwSeparate", "0"));
/* 3177 */       this.m_connStrAttr.rwPercent = Integer.parseInt(props.getProperty(
/* 3178 */         "rwPercent", "75"));
/* 3179 */       this.m_connStrAttr.dbmdChkPrv = Boolean.valueOf(
/* 3180 */         props.getProperty("dbmdChkPrv", "false")).booleanValue();
/*      */       
/* 3182 */       this.m_connStrAttr.uKeyName = props.getProperty("uKeyName", "");
/* 3183 */       this.m_connStrAttr.uKeyPin = props.getProperty("uKeyPin", "");
/*      */       
/* 3185 */       this.m_connStrAttr.wellDistributed = Boolean.valueOf(
/* 3186 */         props.getProperty("wellDistributed", "false"))
/* 3187 */         .booleanValue();
/* 3188 */       this.m_connStrAttr.isBdtaRS = Boolean.valueOf(
/* 3189 */         props.getProperty("isBdtaRS", "true")).booleanValue();
/* 3190 */       this.m_connStrAttr.multiRsCaches = Boolean.valueOf(
/* 3191 */         props.getProperty("multiRsCaches", "false")).booleanValue();
/* 3192 */       this.m_connStrAttr.rsCacheCount = 
/* 3193 */         (Integer.parseInt(props.getProperty("rsCacheCount", "2")) > 5 ? 5 : Integer.parseInt(props
/* 3194 */         .getProperty("rsCacheCount", "2")));
/* 3195 */       this.m_connStrAttr.columnNameUpperCase = Boolean.valueOf(
/* 3196 */         props.getProperty("columnNameUpperCase", "false"))
/* 3197 */         .booleanValue();
/* 3198 */       this.m_connStrAttr.doSwitch = Boolean.valueOf(
/* 3199 */         props.getProperty("doSwitch", "false")).booleanValue();
/* 3200 */       this.m_connStrAttr.clobAsString = Boolean.valueOf(
/* 3201 */         props.getProperty("clobAsString", "false")).booleanValue();
/*      */     }
/*      */     
/* 3204 */     if (this.m_connStrAttr.traceLevel > 0) {
/* 3205 */       String path = "";
/* 3206 */       if (System.getProperty("os.name").startsWith("Win")) {
/* 3207 */         path = "c:\\jdbc_log.txt";
/*      */       } else {
/* 3209 */         path = "/home/jdbc_log.txt";
/*      */       }
/*      */       try {
/* 3212 */         File f = new File(path);
/* 3213 */         if (!f.exists()) {
/* 3214 */           f.createNewFile();
/*      */         }
/* 3216 */         DriverManager.setLogWriter(new PrintWriter(
/* 3217 */           new FileOutputStream(path, true)));
/*      */       } catch (Exception e) {
/* 3219 */         e.printStackTrace();
/*      */       }
/*      */     }
/*      */     
/* 3223 */     initClientInfoWithConnStr();
/*      */   }
/*      */   
/*      */   public boolean getRwSeparate() {
/* 3227 */     if (this.m_connStrAttr.rwSeparate == 1) {
/* 3228 */       return true;
/*      */     }
/* 3230 */     return false;
/*      */   }
/*      */   
/*      */   public int getLobMode() {
/* 3234 */     String value = this.m_clientInfoMapConnStr.getProperty("LobMode");
/* 3235 */     if (value == null) {
/* 3236 */       return this.m_connStrAttr.lob_mode;
/*      */     }
/* 3238 */     return Integer.parseInt(value);
/*      */   }
/*      */   
/*      */   public int getTraceLevel() {
/* 3242 */     String value = this.m_clientInfoMapConnStr.getProperty("traceLevel");
/* 3243 */     if (value == null) {
/* 3244 */       return this.m_connStrAttr.traceLevel;
/*      */     }
/* 3246 */     return Integer.parseInt(value);
/*      */   }
/*      */   
/*      */   public int getInfoLevel() {
/* 3250 */     return this.m_connStrAttr.infoLevel;
/*      */   }
/*      */   
/*      */   public String getAppName() {
/* 3254 */     return this.m_connStrAttr.appName;
/*      */   }
/*      */   
/*      */   public int getConnectTimeout() {
/* 3258 */     return this.m_connStrAttr.connectTimeout;
/*      */   }
/*      */   
/*      */   public int getSessionTimeout() {
/* 3262 */     return this.m_connStrAttr.sessionTimeout;
/*      */   }
/*      */   
/*      */   public final int getSocketTimeout() {
/* 3266 */     return this.m_connStrAttr.socketTimeout;
/*      */   }
/*      */   
/*      */   public boolean getMppLocal() {
/* 3270 */     return this.m_connStrAttr.mppLocal;
/*      */   }
/*      */   
/*      */   public final int getDefaultRowPrefetch() {
/* 3274 */     return this.m_connStrAttr.default_row_prefetch;
/*      */   }
/*      */   
/*      */   public final int getMaxRows() {
/* 3278 */     return this.m_connStrAttr.maxRows;
/*      */   }
/*      */   
/*      */   public final boolean getContinueBatchOnError() {
/* 3282 */     String value = this.m_clientInfoMapConnStr
/* 3283 */       .getProperty("continueBatchOnError");
/* 3284 */     if (value == null) {
/* 3285 */       return false;
/*      */     }
/* 3287 */     return Boolean.valueOf(value).booleanValue();
/*      */   }
/*      */   
/*      */   public final String getURL() {
/* 3291 */     return this.m_connStrAttr.url;
/*      */   }
/*      */   
/*      */   public final String getHostName() {
/* 3295 */     return this.m_connStrAttr.host;
/*      */   }
/*      */   
/*      */   public final void setHostName(String host) {
/* 3299 */     this.m_connStrAttr.host = host;
/*      */   }
/*      */   
/*      */   public boolean getEscape() {
/* 3303 */     return this.m_connStrAttr.m_process_escapes;
/*      */   }
/*      */   
/*      */   public void setEscape(boolean escapeFlag) {
/* 3307 */     this.m_connStrAttr.m_process_escapes = escapeFlag;
/*      */   }
/*      */   
/*      */   public final void setHostPort(int port) {
/* 3311 */     this.m_connStrAttr.port = port;
/*      */   }
/*      */   
/*      */   public final String getLoginName() {
/* 3315 */     return this.m_connStrAttr.login;
/*      */   }
/*      */   
/*      */   public final void setLoginName(String user) {
/* 3319 */     this.m_connStrAttr.login = user;
/*      */   }
/*      */   
/*      */   public final String getPassword() {
/* 3323 */     return this.m_connStrAttr.password;
/*      */   }
/*      */   
/*      */   public final String getPortNumber() {
/* 3327 */     return String.valueOf(this.m_connStrAttr.port);
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   public final boolean getEscapesProcessing()
/*      */   {
/* 3335 */     return this.m_connStrAttr.m_process_escapes;
/*      */   }
/*      */   
/*      */   public Properties getProperties() {
/* 3339 */     return this.m_connProps;
/*      */   }
/*      */   
/*      */   public String getGUID() {
/* 3343 */     return this.m_connServAttr.guid;
/*      */   }
/*      */   
/*      */   public void setGUID(String guid) {
/* 3347 */     this.m_connServAttr.guid = guid;
/*      */   }
/*      */   
/*      */   public void setDbmdChkPrivileges(boolean chk) {
/* 3351 */     this.m_connStrAttr.dbmdChkPrv = chk;
/*      */   }
/*      */   
/*      */   public boolean getDbmdChkPrivileges() {
/* 3355 */     return this.m_connStrAttr.dbmdChkPrv;
/*      */   }
/*      */   
/*      */   public void setNewLobFlag(byte flag) {
/* 3359 */     if (flag != 0) {
/* 3360 */       this.m_connServAttr.new_lob_flag = true;
/*      */     } else
/* 3362 */       this.m_connServAttr.new_lob_flag = false;
/*      */   }
/*      */   
/*      */   public boolean getNewLobFlag() {
/* 3366 */     return this.m_connServAttr.new_lob_flag;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   class ConnServAttr
/*      */   {
/* 3374 */     int language = 0;
/* 3375 */     int tranAccessMode = 0;
/* 3376 */     short tz = Const.TIME_ZONE_DEFAULT;
/*      */     
/* 3378 */     String osName = System.getProperty("os.name", "");
/*      */     
/*      */     short maxRowSize;
/*      */     
/*      */     int maxSession;
/*      */     boolean ddl_auto_commit;
/* 3384 */     int trans_level = -1;
/* 3385 */     boolean caseSensitive = true;
/*      */     boolean backslash_escape;
/*      */     int svrMode;
/*      */     int svrStat;
/* 3389 */     boolean const_para_opt = false;
/* 3390 */     int db_tz = 0;
/*      */     
/*      */     String instanceName;
/*      */     
/*      */     String schema;
/*      */     
/*      */     String lastLoginIP;
/*      */     
/*      */     String lastLoginTime;
/*      */     
/*      */     int failedAttempts;
/*      */     
/*      */     int loginWarningID;
/*      */     
/*      */     int gracetimeRemainder;
/*      */     String guid;
/*      */     boolean new_lob_flag;
/* 3407 */     int encryptMsg = 0;
/* 3408 */     int comprMsg = 0;
/* 3409 */     String dmServerVersion = null;
/* 3410 */     int global_server_series = 0;
/* 3411 */     String m_serverEncoding = null;
/*      */     
/*      */     int networkPacketSize;
/*      */     
/*      */ 
/*      */     ConnServAttr() {}
/*      */   }
/*      */   
/*      */   class ConnStrAttr
/*      */   {
/*      */     String url;
/*      */     String login;
/*      */     String password;
/*      */     String host;
/*      */     int port;
/* 3426 */     boolean mppLocal = false;
/*      */     
/* 3428 */     int socketTimeout = 0;
/* 3429 */     boolean continueBatchOnError = true;
/* 3430 */     boolean m_process_escapes = true;
/* 3431 */     int connectTimeout = 0;
/* 3432 */     boolean auto_commit = true;
/* 3433 */     int maxRows = 0;
/* 3434 */     int default_row_prefetch = 10;
/* 3435 */     int lob_mode = 1;
/*      */     
/*      */ 
/*      */ 
/* 3439 */     int stmtPoolSize = 0;
/* 3440 */     boolean ignoreCase = true;
/* 3441 */     boolean comOra = false;
/* 3442 */     int infoLevel = 1;
/* 3443 */     boolean alwayseAllowCommit = true;
/* 3444 */     int batchType = 1;
/*      */     int maxCachedPstmtSize;
/* 3446 */     int traceLevel = 0;
/* 3447 */     String appName = "";
/* 3448 */     int sessionTimeout = 0;
/* 3449 */     boolean isCompress = false;
/* 3450 */     String sslFilesPath = "";
/* 3451 */     String sslKeystorePass = "";
/* 3452 */     int resultSetType = 1003;
/* 3453 */     String kerberosLoginConfPath = "";
/* 3454 */     int rwSeparate = 0;
/* 3455 */     int rwPercent = 25;
/* 3456 */     boolean dbmdChkPrv = false;
/*      */     
/*      */ 
/* 3459 */     String uKeyName = "";
/* 3460 */     String uKeyPin = "";
/*      */     
/*      */ 
/* 3463 */     boolean wellDistributed = false;
/* 3464 */     boolean isBdtaRS = true;
/* 3465 */     int rsCacheCount = 2;
/* 3466 */     boolean multiRsCaches = false;
/* 3467 */     boolean columnNameUpperCase = false;
/*      */     
/* 3469 */     boolean doSwitch = false;
/*      */     
/* 3471 */     boolean clobAsString = false;
/*      */     
/*      */     ConnStrAttr() {} }
/*      */   
/* 3475 */   private static boolean isExecute2(String serverVersion, String globalVersion) { String[] serStrs = serverVersion.split("\\.");
/* 3476 */     String[] globalStrs = globalVersion.split("\\.");
/*      */     
/*      */ 
/* 3479 */     for (int i = 0; i < serStrs.length; i++) {
/* 3480 */       Integer ser = Integer.valueOf(serStrs[i]);
/* 3481 */       Integer global = Integer.valueOf(globalStrs[i]);
/* 3482 */       if (ser.intValue() > global.intValue())
/* 3483 */         return true;
/* 3484 */       if (ser.intValue() != global.intValue())
/*      */       {
/*      */ 
/* 3487 */         return false;
/*      */       }
/*      */     }
/* 3490 */     return false;
/*      */   }
/*      */   
/*      */   public boolean isBdtaRS() {
/* 3494 */     return this.m_connStrAttr.isBdtaRS;
/*      */   }
/*      */   
/*      */   public void setIsBdta(boolean isBdta) {
/* 3498 */     this.m_connStrAttr.isBdtaRS = isBdta;
/*      */   }
/*      */   
/*      */   public int getRscacheCount() {
/* 3502 */     return this.m_connStrAttr.rsCacheCount;
/*      */   }
/*      */   
/*      */   public boolean getMultiRsCaches() {
/* 3506 */     return this.m_connStrAttr.multiRsCaches;
/*      */   }
/*      */   
/*      */ 
/* 3510 */   private boolean pwd_encrypt = false;
/* 3511 */   private boolean m_rwSeparate = false;
/*      */   
/*      */   public boolean pwd_encrypt() {
/* 3514 */     return this.pwd_encrypt;
/*      */   }
/*      */   
/*      */   public void setPwdEncrypt(boolean pwd_encrypt) {
/* 3518 */     this.pwd_encrypt = pwd_encrypt;
/*      */   }
/*      */   
/*      */   public DmdbPooledConnection_bs getMpc() {
/* 3522 */     return this.m_pc;
/*      */   }
/*      */   
/*      */   public double getRwPercent() {
/* 3526 */     return this.m_connStrAttr.rwPercent;
/*      */   }
/*      */   
/*      */   public boolean isRwSeparate() {
/* 3530 */     return this.m_rwSeparate;
/*      */   }
/*      */   
/*      */   public void setRwSeparate(boolean b) {
/* 3534 */     this.m_rwSeparate = b;
/*      */   }
/*      */   
/*      */   public boolean getColumnNameUpperCase() {
/* 3538 */     return this.m_connStrAttr.columnNameUpperCase;
/*      */   }
/*      */   
/*      */   public boolean doSwitch() {
/* 3542 */     return this.m_connStrAttr.doSwitch;
/*      */   }
/*      */   
/*      */   public boolean getClobAsString()
/*      */   {
/* 3547 */     return this.m_connStrAttr.clobAsString;
/*      */   }
/*      */ }


/* Location:              D:\Program Files\DBMS_20150813\jdbc\Dm7JdbcDriver17.jar!\dm\jdbc\driver\DmdbConnection_bs.class
 * Java compiler version: 2 (46.0)
 * JD-Core Version:       0.7.1
 */